Author Topic: Why Johnny Can't Code  (Read 19058 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Why Johnny Can't Code
« Reply #75 on: September 29, 2011, 08:26:37 pm »
FizzBuzz

Code: [Select]
100.times do |index|
   puts (index%3==0)?("fizz"):((index%5==0)?("buzz"):(index.to_s))
end

Give me a cookie now.

I tried, but it was a volatile cookie and your session was unexpectedly refreshed before you could receive it.
« Last Edit: September 29, 2011, 08:26:51 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: Why Johnny Can't Code
« Reply #76 on: September 29, 2011, 08:31:15 pm »
FizzBuzz

Code: [Select]
100.times do |index|
   puts (index%3==0)?("fizz"):((index%5==0)?("buzz"):(index.to_s))
end

Give me a cookie now.

I tried, but it was a volatile cookie and your session was unexpectedly refreshed before you could receive it.

:<

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Why Johnny Can't Code
« Reply #77 on: September 30, 2011, 12:11:52 am »
.FIZZBUZZ
For(Q,1,100)
!If Q^3
Disp "FIZZ"
End
!If Q^5
Disp "BUZZ"
End
If Q^3?Q^5
Disp Q
End
Disp i
End
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!