Kernighans large earthquake problem: Difference between revisions

Content added Content deleted
Line 775: Line 775:


%f
%f
dup "r" fopen >f
dup "r" fopen !f
<f 0 less ( [drop "Could not open '" print print "' for reading" print -1 end ] [drop] ) if
$f 0 < ( [drop "Could not open '" print print "' for reading" print -1 end ] [drop] ) if


[dup split 3 get tonum 6 great ( [drop print nl] [drop drop] ) if]
[dup split 3 get tonum 6 > ( [drop print nl] [drop drop] ) if]
[<f fgets dup -1 nequal]
[$f fgets dup -1 #]
while
while


drop
drop
<f fclose
$f fclose


"End " input</lang>
"End " input</lang>