DEV Community

Discussion on: 100 Languages Speedrun: Episode 31: Fortran

Collapse
 
dforgeas profile image
dforgeas

I noticed that FIZZBUZZ still prints the multiples, 3, 5, 6, 9, 10 and so on. Is there a way to skip line 40?

Collapse
 
taw profile image
Tomasz Wegrzanowski

Oh wow, you're right, I totally missed that. Somehow I thought CONTINUE in Fortran is like continue in C and other C-likes, and didn't pay attention to the output.

Turns out CONTINUE in Fortran does literally nothing, and it's only used as placeholder (like Python pass).

The correct thing seems to be CYCLE instead of CONTINUE.

Collapse
 
dforgeas profile image
dforgeas • Edited

I just tried CYCLE and indeed:

           1
           2
 FIZZ    
           4
 BUZZ    
 FIZZ    
           7
           8
 FIZZ    
 BUZZ    
          11
Enter fullscreen mode Exit fullscreen mode

By the way thanks for the terrific "speedrun". I'm looking forward to reading it all.