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.2008-11-08)

442.   What is erlang (and why should I care?)   [aestetix/2008-06-01]
404.   How can I limit the ammount of bandwidth rsync over ssh (or anything else) uses, without a complicated firewall solution?   [leif/2004-02-06]
381.   What is that pesky System.map file anyway?   [jake/2003-09-25]
351.   How can I setup netware services / mount netware servers in linux?   [jake/2003-02-25]
320.   why wont my indy receive a kernel via tftp?   [jesse/2002-08-10]
318.   whats a good webmail system?   [jesse/2002-06-21] ( chota/2003-07-26 )
273.   Where do I find a free comma delimited file with all USA zipcodes, including longitude and latitude?   [les/2001-09-06]
259.   What is #temp   [ross/2001-08-10]
246.   why am i getting errors with when reflashing my TINI from a linux box?   [jesse/2001-06-09]
183.   What are the real lyrics for the poem "Big Rock Candy Mountains"?   [rupe/2001-02-19] ( jesse/2001-06-29 )
180.   Why is that dwarf always following me?   [vonguard/2001-02-17]
123.   How do I check for the existence of a file in Python?   [rupe/2000-09-25]
32.   What are the 'mailer' flags (on the M lines) inside sendmail.cf ?   [strick/2000-01-25]
31.   Was Ross at Kevin Mitnick's release?   [strick/2000-01-23]