Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Which touhou would you program with?

Name: Anonymous 2017-06-28 6:16

Discuss.

Name: Anonymous 2017-07-02 3:44

>>23
That's mental midget thinking.
no it's not, C syntax is pretty easy to understand and using a similar one for both languages makes it easier for them to learn both
Whether the language is good or bad is irrelevant

lisp fizzbuzz:
(defun fizzbuzz ()
(loop for x from 1 to 100 do
(princ (cond ((zerop (mod x 15)) "FizzBuzz")
((zerop (mod x 3)) "Fizz")
((zerop (mod x 5)) "Buzz")
(t x)))
(terpri)))



Smalltalk fizzbuzz
(1 to: 100) do:
[:n |
((n \\ 3)*(n \\ 5)) isZero
ifFalse: [Transcript show: n].
(n \\ 3) isZero
ifTrue: [Transcript show: 'Fizz'].
(n \\ 5) isZero
ifTrue: [Transcript show: 'Buzz'].
Transcript cr.]



C fizzbuzz
int main() {
int i = 1;
while(i <= 100) {
if(i % 15 == 0)
puts("FizzBuzz");
else if(i % 3 == 0)
puts("Fizz");
else if(i % 5 == 0)
puts("Buzz");
else
printf("%d\n", i);
i++;
}
return 0;
}



Java fizzbuzz
public static void main(String[] args){
for(int i= 1; i <= 100; i++){
if(i % 15 == 0){
System.out.println("FizzBuzz");
}else if(i % 3 == 0){
System.out.println("Fizz");
}else if(i % 5 == 0){
System.out.println("Buzz");
}else{
System.out.println(i);
}
}
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List