72dpiarmy

we talk about stuff
It is currently Mon Sep 06, 2010 6:50 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Doing stuff that is very powerful, and very easy (for i)
PostPosted: Sat Jul 18, 2009 12:53 pm 
Offline
Almost Regular
User avatar

Joined: Tue Oct 07, 2008 8:00 pm
Posts: 242
Something I'm going to teach is a loop

Loops are probably one of the few things I've learned in programming that is particularly interesting besides creating your own methods and structures

in many programming languages (including Java script) there is a looping Mechanism (I don't care about the real names) that allows you to loop a number of times while also having a variable

For example
(lulz.... For...)

For a = 0 to 99
System.out.println("a is equal to " + a)
Next

If you want to try it out on Java script (since that is going to be one of the few places you will be able to try it out without downloading an extremely unhappilly large programming environment)

Try this


<div id="panel">
<script type="text/javascript">
var i;
for(i=1; i<20;i++){
document.write("a is equal to " + i + "<br>");
}
</script>
</div>


To do this with some arrays
var arrayz = [];
arrayz[0] = stuff;
arrayz[2] = moar stuff;
arrayz[1] = less stuff;

then make...
for(i=0; i<2; i++){


Try it.... it might work :O


Example of my java Script Playground

_________________
I want the wisest things to happen
If you like stuff. That stuff will always exsist.... IN YOUR MIND! OH SHNAP! UNLESS U FORGETZ IT! OR SHNAP! maybe...
Destryers Inc


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group