1.upto 100 do |a|
b = false
if (a % 3 == 0) then
b = true; print "Fizz" end
if (a % 5 == 0) then
b = true; print "Buzz" end
unless b print a end
print "\n"
end
#define procedure void
#define main:() main() {
#define for ;for(int
#define to ; i <=
#define do ;++i){
#define is ==
#define isnt !=
#define and &&
#define or ||
#define := =
#define end );}}
#define mod %
#define print ;puts(
#define let ;char
#define [...] []
#define if ;if(
#define then )
procedure main:()
let op[...] := { "", "Fizz\n","Buzz\n","FizzBuzz\n" }
let in := 0
for i := 1 to 100 do
in := 0
if i mod 3 is 0 then
in := 1
if i mod 5 is 0 then
in := in + 2
print opin
end
10 LET A=0
20 LET A=A+1
30 IF A MOD 15=0 THEN 80
40 IF A MOD 3=0 THEN 100
50 IF A MOD 5=0 THEN 120
60 GOTO 140
80 PRINT"FIZZBUZZ"
90 GOTO 20
100 PRINT"FIZZ"
110 GOTO 20
120 PRINT"BUZZ"
130 IF A<100 THEN 20
131 SLEEP
132 END
140 PRINT A
150 GOTO 20
Name:
Anonymous2011-12-27 10:33
(defun mult? (n m)
(eql (mod n m) 0))
(defun fizz-buzz ()
(dotimes (x 100)
(if (mult? (1+ x) 3)
(format t "Fizz"))
(if (mult? (1+ x) 5)
(format t "Buzz")
;; else
(if (not (mult? (1+ x) 3))
(format t "~d" (1+ x))))
(format t "~%")))
I don't get it guys, I wrote a fizzbuzz with no conditional. And it is in C, not a lesser language like lisp. why are you still working on the problem?
>>36
Any compiler that compiles that is not a real C compiler, those are not valid identifiers for a macro, hate to tell you but your compiler is shit.
Name:
Anonymous2011-12-28 3:21
>>17
proggles.c:12:9: error: macro names must be identifiers
Name:
Anonymous2011-12-28 3:37
>>42
get a better compiler with a better preprocessor
>>41
u jelly that my own compiler has a better preprocessor than your shitty default gnu one?
I'm amazed people on /prog/ aren't capable of making their own preprocessor for their own compiler or hell even a preprocessor that then pipes into gcc,tcc,etc
The reason using a non-compliant C compiler is wrong is because non-standard code will not compile on a compliant compiler. If your code is only going to compile on your compiler on your machine then go ahead and use non-standard stuff, but if you're posting it on the Internet where everyone uses different compilers, and you expect people to not be annoyed by your use of non-standard 'features', then you're a retard.
>>55
A useful subset of GNU C is followed by gcc itself, clang and tcc.
Name:
Anonymous2011-12-28 13:28
>>56 A useful subset of GNU C is followed by gcc itself, clang and tcc.
ICC as well, and that's because most of the GNU extensions are sane and useful, your shitty broken preprocessor isn't, it's fucking harmful and retarded. So fuck off with your toy language you piece of shit moron.
Name:
Anonymous2011-12-28 13:40
Check your lips at the door woman, shake your hips like battleships.
Name:
Anonymous2011-12-28 14:19
>>57
Post >>56 was the first one I made in this thread, ``fatflaps''.
for i = 0,99 do print(({"fizz","buzz","fizzbuzz"})[math.floor(0x30490610/2^(i*2%30)%4)] or i+1) end
Terrible! back to javascript!
Name:
Anonymous2011-12-28 16:06
I ran this code and it hacked my virus.
Name:
Anonymous2011-12-28 16:31
>>62 >>60 >>55
Y'all niggas so mad. I use gcc just like you, but I pipe my files through my perl preprocessor script which then compiles via gcc. Keep on hatin
>>68
Changing preprocessor rules =/= making a new language
To you anyone that uses non-standard C is then using some silly toy language.
Name:
Anonymous2011-12-28 16:41
>>69
Standard C preprocessor is a separate language to Standard C. You are using non-standard C preprocessor, which is yet another language; the third language referenced in this post.
It's ok if your code remains within the standard, and you can give gcc options to only accept standard C (although in my experience, it still accepts things like nested functions in ansi mode).
I thoought it might have been the old version, but when I compile that code without the -pedantic flag, it works fine and doesn't complain about the nested function. One would expect the -ansi flag to be sufficient. But oh well. I guess if you want your code to be portable across compilers, you better use -pedantic.
>>69
You're using a different language, whatever piece of shit toy language you're using it does not conform to the C standard, therefore it must be a different language.
Name:
Anonymous2011-12-29 0:43
>>84
GNU GCC C is a toy language, say it faggot. FUCKING SAY IT
Name:
Anonymous2011-12-29 0:52
>>85
ANSI C is a faggot toy language, real men use GNU C.
Name:
Anonymous2011-12-29 0:55
>>86
K & R C > ANSI C > ISO C > GNU C > TOY LANGUAGE C
>>87 In 1983, the American National Standards Institute (ANSI) formed a committee, X3J11, to establish a standard specification of C. In 1989, the standard was ratified as ANSI X3.159-1989 "Programming Language C". This version of the language is often referred to as ANSI C, Standard C, or sometimes C89.
In 1990, the ANSI C standard (with formatting changes) was adopted by the International Organization for Standardization (ISO) as ISO/IEC 9899:1990, which is sometimes called C90. Therefore, the terms "C89" and "C90" refer to the same programming language.
ANSI, like other national standards bodies, no longer develops the C standard independently, but defers to the ISO C standard. National adoption of updates to the international standard typically occurs within a year of ISO publication.