![]() |
for loops
can you make a for loop that will accept more than one command during each loop?
|
Re: for loops
Quote:
for(this.i=0;this.i<=10;this.i++;){ //coding } or something like this this.i=0; while(this.i<=10){ this.i++; //coding } |
yep.. but while is a while loop not a for loop..
My favorite nested for loops :) |
Quote:
and anyways for loops turn into while loops when you execute it (press f6 and look at the coding it turns for loops into while loops) |
No If i must i will open my computer programming book
I dont care what graal says. For loops incrment till the number value is unture. While loops do {} while () that is true.. for has to be a number.. U use For if u know how many times u want to loop and for numbers While does stuff till it changes I know u were giveing an example |
Quote:
but I was first giving an example of different ways of doing the loop... and second graal converts for loops into while loops when it runs the coding... that is all I said... i know while loops can have other things then numbers and for loops only can have numbers... but I was saying that graal converts for loops into while loops when you run it... (well at lest in the debug screen) |
Ok but i speak in programming terms i do not know how the graal engine does stuff
|
for (i=1;i>0;i++){
for(j=1;i<0;j++){ }} ahh yes the nested for loop is a mans best friend |
The best loops are made with timeout=.05.
ADDED FOR ESSENTIAL GEEKINESS: A timeloop in Graal is basically a self-calling function. I'm trying to get a function to call itself in graal...doesn't work too good. So I'll pass function Moby through function ****, having them call each other, whilst having function melville, place that in functions moby and ****...Melville triggered once, lagged a lot...timeout works better. Later I'll try it with a sleep command. |
you do not need timeouts for loops unless you want them to run more than one time in a row, and i dont think doing for(#,#,#){commands;} will work because the for loop looks for ; in the loop and that is where the loop ends and starts with the next number, but i may be mistaken
|
Yes finally some one understands nested for loops.. man.. no one said anything about that..
It is great for doing things like hitobjects and so on.. taking a 17kb weapon and make it to a 2kb weapon is great just becuase of for loops.. and yes for loops are like this for(variable=#;variable logicstatment #;variable incrementation){Commands} first part sets the variable to that value when it starts, logic statments are like = < > , I++ adds 1 to i each time Hey shin wanna job as scripter on server. Anyone that knows what a nested for is is cool in my book lol |
i wish we could do stuff like..
for(i=0,j=0;i<100,j<100;i++,j++;) {commands;} |
Why.. j and i would always be =.. what is the use
|
Quote:
well kinda of like for(this.x=0;this.x<=10;this.x++) for(this.y=0;this.y<=10;this.y++){ //coding } I think he means like so it would run it like that |
I have not tried can u do 2 conditon staments like x>0&&y<45
if so then u could do that ...just increment y inside the loop |
| All times are GMT +2. The time now is 06:36 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.