Last active
December 17, 2015 11:59
-
-
Save Theby/5606914 to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
for(int i=0;i<100;i++){ | |
if(i%15==0){ | |
printf("FizzBuzz, "); | |
}else if(i%3==0){ | |
printf("Fizz, "); | |
}else if(i%5==0){ | |
printf("Buzz, "); | |
}else{ | |
printf("%d, ",i); | |
} | |
} | |
printf("Buzz.\n"); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "DLL/import.prg"; | |
PROCESS main() | |
PRIVATE | |
int i,j; | |
char palabra[8] = "hola"; | |
BEGIN | |
set_title("FizzBuzz"); | |
set_mode(480,320,MODE_32BITS,MODE_WINDOW); | |
set_fps(60,9); | |
j=-1; | |
FOR(i=0;i<101;i++) | |
IF(i%15==0) | |
palabra = "FizzBuzz"; | |
ELIF(i%3==0) | |
palabra = "Fizz"; | |
ELIF(i%5==0) | |
palabra = "Buzz"; | |
ELSE | |
palabra = ""+i; | |
END | |
IF(i%7==0) | |
j++; | |
END | |
IF(i!=100) | |
write(0,0+65*(i%7),0+10*j,0,palabra+", "); | |
ELSE | |
write(0,+65*(i%7),0+10*j,0,"Buzz."); | |
END | |
END | |
LOOP | |
IF(KEY(_ESC)) | |
exit(0); | |
END | |
FRAME; | |
END | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment