by jake

Where can I see an example of looping code in G and in C?

Turn this:

 for (i=0; i<5; i++)
    array[i] = random();
 sum = 0;
 for (i=0; i<5; i++)
    sum += array[i];


Into this:




Programming with G!

 


 
Read more of   The Yak's Frequently Questioned Answers   (mod.2010-02-10)

441.   What is Conware?   [jake/2006-12-22]
437.   How do I wash a feather comforter?   [n0b0dy/2006-08-13]
430.   How can I migrate my encrypted gpassman files to ascii?   [jake/2006-05-20]
420.   How can I use a new 40 Gig iPod with Debian and USB   [jake/2005-03-01]
372.   What is the offical 'insta-gay' drink™ of #temp?   [ross/2003-09-16]
366.   What is a really good german street map website?   [jake/2003-07-10]
291.   Should I solder my Sound Card into my computer?   [strick/2002-02-04]
265.   Who is Brad   [brad/2002-07-16]
244.   Does Jeffrey read too many web comics each day?   [strick/2001-06-06]
221.   Where can I find information about odd places in San Francisco?   [rupe/2001-06-04]
179.   How can I become a hacker?   [strick/2001-06-21] ( rupe/2001-02-28 )
158.   Where's a good place to start to learn about the IETF (Internet Engineering Task Force)?   [rupe/2001-01-02]
150.   Where can I find information on the Sony Magic Cap PDA?   [rupe/2000-12-08]
82.   Can Mice Fly ?   [philbert2k/2000-04-27]
74.   How many roads must a man walk down?   [vonguard/2000-04-04]
55.   How can i find out what other websites have links to my website?   [jamison/2000-02-11]
46.   What is Ross' natural hair color?   [macki/2000-02-03]
19.   What DNS servers does the YAK use?   [strick/2001-05-25]
13.   What internet security sites should I read?   [strick/2000-01-17]