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-06-12)

437.   How do I wash a feather comforter?   [n0b0dy/2006-08-13]
376.   What are three very useful online dictionaries?   [jake/2003-09-22]
359.   Is Larry Wall on crack?   [strick/2003-04-10]
341.   Can you give me some pointers for using gpg/pgp and other encryption?   [jake/2002-12-19]
328.   What the hell is zen nihlism (how can I sign up my neighbor)?   [jake/2002-10-05]
283.   What is the beautiful font used in the movie "Bicentennial Man" ?   [rupe/2001-11-09]
201.   Where are Mir, the Shuttle, and the ISS right now?   [rupe/2001-03-22]
123.   How do I check for the existence of a file in Python?   [rupe/2000-09-25]
117.   Where can I find information on character codes, and encoding issues?   [rupe/2000-09-12]
114.   Where's a good place to find advice about 401(k) plans?   [rupe/2000-08-07]
80.   Where did the concept of an FQA come from?   [rupe/2000-04-25]
42.   What is there worth seeing in the city of Louisville, Kentucky?   [chota/2001-05-26]
34.   What are some good World Wide Web facts I can impress my friends with?   [simon/2000-01-28]