[wellylug] Non-standard languages on Linux
Phillip Hutchings
sitharus at gmail.com
Tue May 10 11:44:43 NZST 2005
Sorry, brain 3/4 asleep. Remove the x++ lines, that was from something else.
> c99:
> int main(int argc, char[] *argv)
> {
> for (int x = 0; x < 5; x++)
> {
> printf("%i", x);
> }
> return 0;
> }
>
> python:
> def main(argc, argv):
> for x in range(4):
> print "%i" % x
>
> Ruby (for completeness):
> def main(argc, argv)
> 4.times do |i|
> puts i.to_s
> end
> end
--
Phillip Hutchings
http://www.sitharus.com/
sitharus at gmail.com / sitharus at sitharus.com
More information about the wellylug
mailing list