Discuss Scratch

Jonathan50
Scratcher
1000+ posts

What's the funniest code we can think of?

DigiTechs wrote:

liam48D wrote:

colt05 wrote:

liam48D wrote:

colt05 wrote:

if pong was a hostname…
bash:
ping pong
You can add ping to your hosts.etc (is that the file?) and the code will work
lol. where's hosts.etc?
/etc/hosts, not sure what the equivalent is for windows.

Ironically, also in /etc/hosts - but you have to navigate to C:\Windows\System32\drivers first.
That's because Windows TCP/IP stack is based on the BSD one.
liam48D
Scratcher
1000+ posts

What's the funniest code we can think of?

Jonathan50 wrote:

liam48D wrote:

colt05 wrote:

if pong was a hostname…
bash:
ping pong
You can add ping to your hosts.etc (is that the file?) and the code will work
/etc/hosts (aka HOSTS file), you mean?
Yeah, I checked later.
JonathanSchaffer
Scratcher
1000+ posts

What's the funniest code we can think of?

from weird import so-dumb
from time import sleep
while True
   lol("nothing")
   if (Im mad)
      crash the computer
      take no responsibility
      move to("china")
   take over("python 3")
   print("What the..")
   sleep(2)
   print("I know python")
NoMod-Programming
Scratcher
1000+ posts

What's the funniest code we can think of?

liam48D wrote:

Jonathan50 wrote:

liam48D wrote:

colt05 wrote:

if pong was a hostname…
bash:
ping pong
You can add ping to your hosts.etc (is that the file?) and the code will work
/etc/hosts (aka HOSTS file), you mean?
Yeah, I checked later.
Actually wouldn't you need to add “pong” to your hosts file (not ping)?
liam48D
Scratcher
1000+ posts

What's the funniest code we can think of?

NoMod-Programming wrote:

liam48D wrote:

Jonathan50 wrote:

liam48D wrote:

colt05 wrote:

if pong was a hostname…
bash:
ping pong
You can add ping to your hosts.etc (is that the file?) and the code will work
/etc/hosts (aka HOSTS file), you mean?
Yeah, I checked later.
Actually wouldn't you need to add “pong” to your hosts file (not ping)?
Yeah.. idk why my post was so bad lol.
Gaza101
Scratcher
500+ posts

What's the funniest code we can think of?

>>> class Expectations(Exception):
    def __init__(self):
        super(Expectations,self).__init__("raised")
 
>>> raise Expectations
 
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    raise Expectations
Expectations: raised
Ha.
Dylan5797
Scratcher
1000+ posts

What's the funniest code we can think of?

JonathanSchaffer wrote:

from weird import so-dumb
from time import sleep
while True
   lol("nothing")
   if (Im mad)
      crash the computer
      take no responsibility
      move to("china")
   take over("python 3")
   print("What the..")
   sleep(2)
   print("I know python")
You can't have hyphens in import names. Variables can't have spaces. You have to have a colon after while True and if (Im mad)
OSimulators
Scratcher
68 posts

What's the funniest code we can think of?

My random code:
when green flag clicked
move [How is this possible? v] steps
forever

forever

forever

forever

forever

forever

forever

forever

forever

forever

forever
say [hi v] for [a billion v] secs
end

end

end

end

end

end

end

end

end

end

end
Yeah.. I was bored XD.
Spooikypok_Dev
Scratcher
100+ posts

What's the funniest code we can think of?

make sure you're root!

sudo sudo sudo (unnecessary repetitions removed by moderator - please keep it brief)

Last edited by Paddle2See (April 18, 2016 17:14:04)

liam48D
Scratcher
1000+ posts

What's the funniest code we can think of?

Spooikypok_Dev wrote:

make sure you're root!

sudo sudo sudo sudo sudo […]
That was.. unnecessary.
Spooikypok_Dev
Scratcher
100+ posts

What's the funniest code we can think of?

liam48D wrote:

Spooikypok_Dev wrote:

make sure you're root!

sudo sudo sudo sudo sudo […]
That was.. unnecessary.
Yup!
Jonathan50
Scratcher
1000+ posts

What's the funniest code we can think of?

Spooikypok_Dev wrote:

make sure you're root!

sudo sudo sudo (unnecessary repetitions removed by moderator - please keep it brief)
Only the first one was necessary
scratchisthebest
Scratcher
1000+ posts

What's the funniest code we can think of?

comp09
Scratcher
1000+ posts
-Radical-
Scratcher
500+ posts

What's the funniest code we can think of?

Spooikypok_Dev wrote:

sudo sudo sudo (unnecessary repetitions removed by moderator - please keep it brief)

WDYM unnessessary—you can never be too root!
DigiTechs
Scratcher
500+ posts

What's the funniest code we can think of?

comp09 wrote:

https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition

This is too true. Like, I'm a fan of OOP but when it gets to some crazy level like that it just gets pointless. For example, if I were to write that code, I'd have three classes:

  • Translator (for translating ‘Fizz’ and ‘Buzz’ or any other string I'd need. It would use .pot files to provide the translations.)
  • Main (because the program needs an entry point)
  • FizzBuzz (to do the actual work of the program)

I'm a fan of small, extendible classes which are functional.

Last edited by DigiTechs (April 19, 2016 15:33:00)

Jonathan50
Scratcher
1000+ posts

What's the funniest code we can think of?

DigiTechs wrote:

This is too true. Like, I'm a fan of OOP but when it gets to some crazy level like that it just gets pointless. For example, if I were to write that code, I'd have three classes:

  • Translator (for translating ‘Fizz’ and ‘Buzz’ or any other string I'd need. It would use .pot files to provide the translations.)
  • Main (because the program needs an entry point)
  • FizzBuzz (to do the actual work of the program)

I'm a fan of small, extendible classes which are functional.
The fact that you'd have any classes other than Java's required main class for such a trivial application is almost disturbing

(use gettext)

Last edited by Jonathan50 (April 19, 2016 22:10:12)

scratchisthebest
Scratcher
1000+ posts

What's the funniest code we can think of?

Jonathan50 wrote:

DigiTechs wrote:

This is too true. Like, I'm a fan of OOP but when it gets to some crazy level like that it just gets pointless. For example, if I were to write that code, I'd have three classes:

  • Translator (for translating ‘Fizz’ and ‘Buzz’ or any other string I'd need. It would use .pot files to provide the translations.)
  • Main (because the program needs an entry point)
  • FizzBuzz (to do the actual work of the program)

I'm a fan of small, extendible classes which are functional.
The fact that you'd have any classes other than Java's required main class for such a trivial application is almost disturbing

(use gettext)
Ohhhhhh my goodness someone's making something extendable. Call the cops.
Dylan5797
Scratcher
1000+ posts

What's the funniest code we can think of?

>>> def ish(a, b):
    return 0 - a * b
>>> multiply = 0
>>> multiply-ish(4, 7)
28
Firedrake969
Scratcher
1000+ posts

What's the funniest code we can think of?

yeah we need to extend the fizzbuzz program
somehow
idk how tho

(disclaimer - I have no experience in Java)

Powered by DjangoBB