[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.9429946 [View]
File: 125 KB, 500x358, 1510270439396.png [View same] [iqdb] [saucenao] [google]
9429946

>>9429942
Yeah it'll just take the entire planet's effort and 20 years but sure.

>> No.9360594 [View]
File: 125 KB, 500x358, 1510270439396.png [View same] [iqdb] [saucenao] [google]
9360594

>>9360501
>you can count to 31 on one hand in finger binary
>you can count to 160 on two hands in finger binary
I feel as if I were cheated as a toddler.

>> No.9335880 [View]
File: 125 KB, 500x358, 1510270439396.png [View same] [iqdb] [saucenao] [google]
9335880

>>9335875
0 and O, my nigger.

>> No.9329620 [View]
File: 125 KB, 500x358, 1510270439396.png [View same] [iqdb] [saucenao] [google]
9329620

>>9328664
Why was the post deleted

>> No.9307114 [View]
File: 125 KB, 500x358, 1510270439396.png [View same] [iqdb] [saucenao] [google]
9307114

Code syntax are determined by the writer.

I remember code confusing me when I was younger and it wasn't until i started playing around with it with immeduate visual feedback that I started to realize how simple it is. It's really simple.
Java is by far the most human readable modern language, as well as syntatically sensible in writing.

Lets make an object for storing an X and Y coordinate

class NAME {
[math]~int[/math] x;
[math]~int[/math] y;

[math]~NAME[/math](int a, int b){
[math]\quad x [/math]=a;
[math]\quad y [/math]=b;
[math]~ [/math]}
}

Now we can use this object as a data type for storing x,y coordinates, with simple dot access.

NAME asdfg = new NAME(7,3);

print(asdfg.x + asdfg.y)
>prints "10"

how to setup an array? just write the datatype followed by brackets and initialize it.

NAME[] asdfgList = new NAME[50];
The [50] is our initial list size. It could be any number, it could be a determined number. An array must be initialized with a definite limit, but an arraylist can be appended and allowed to initialize with [0].

for (int i=0; i<asdfgList.length; i++){
[math]~asdfgList[i].x [/math] = i*2;
[math]~asdfgList[i].y [/math] = i*i;
}
this block will populate our array with x and y values at each index position of [i] between the initial 0 <int i = 0> and limit of the array's length of 50. The x values would be the index value times two, and the y values would be index value squared.

Navigation
View posts[+24][+48][+96]