I was bored for a few minutes yesterday and here's some of the results.
In Fortran:
<font class="small">Code:</font><hr /><pre>
INTEGER x, y
DO 100 y = 1, 9
DO 200 x = 1, 4999
PRINT*, 'you guys are cheaters'
200 CONTINUE
PRINT*, 'the end'
PRINT*, 'Fortran rocks'
100 CONTINUE
STOP
END
</pre><hr />
In C (old school):
<font class="small">Code:</font><hr /><pre>
#include <stdio.h>
main()
{
int x, y;
for(y=1; y<10; y++) {
for(x=1; x<5000; x++) {
puts("you guys are cheaters");
}
puts("the end\nC rocks");
}
}
</pre><hr />
In C++ (newer school):
<font class="small">Code:</font><hr /><pre>
#include <iostream>
main()
{
for(int y=1; y<10; y++) {
for(int x=1; x<5000; x++) {
std::cout << "you guys are cheaters\n";
}
std::cout << "the end\nC++ rocks\n";
}
}
</pre><hr />
In a modern interpreted language (Python):
<font class="small">Code:</font><hr /><pre>
for y in range(1, 10):
for x in range(1, 5000):
print 'you guys are cheaters'
print 'the end\nPython rocks'
</pre><hr />
or if you enjoy the I can do that in one line game:
<font class="small">Code:</font><hr /><pre>
print ('you guys are cheaters\n'*4999 + 'the end\nPython really rocks\n')*9,
</pre><hr />
Cary