Share your repls and programming experiences

← Back to all posts
Haiku Simulator
Pinhead69 (17)

This is just something I made to escape the plague of boredom
Any criticism/comments/ ideas will be looked at and appreciated :D

sErn (9)

Hey, I would recommend using a switch-case statement to shorten up this code by a lot. What a switch-case statement does is take an argument, in this case the users' input, and check if it equals a certain value. This removes the need to write an if statement for every number. You can do this by writing this:

switch userNumber {
case 1: print("This is not okay")
case 2: print("There once was a boy")
default: break

This statement takes userNumber as the argument, then uses case to check if it equals 1 or 2. If it equals 1 it will print "This is not okay" or if it equals 2 it will print "There once was a boy". Make sure to add default: break at the end so it will break out of the switch statement. Keep doing this with each number and the two other inputs and you're done.

Pinhead69 (17)

@sErn WOW, thanks, I didn't know that I could do that or even that cases even existed, thanks G, u should run for president tbh

LordPancake (2)

The haiku sounds like something that could happen.

This is not okay
Who knew people would act weird
I was promised peace

AidenPython (2)

Pleasure to meet you
You have chose the wrong number
Can this get any worse?


Pinhead69 (17)

@AidenPython The machine had first impressions but changed it's mind once you picked the wrong number lol

amasad (3383)

Maybe I'll go out
Don't you dare touch me, stinky
Finally, frozone

I feel bullied.

Pinhead69 (17)

@amasad tis a sign from the gods, don't go outside

Zavexeon (1162)
Not even a sign
I don't have any regrets
this is your warning

Is that a threat? :o

Pinhead69 (17)

@Zavexeon For legal reasons, my lawyer told me to say no lol

Pinhead69 (17)

@Zavexeon Not the BanHammer lmao

PhoenixSaid (0)

Man that's deep...
The world was cruel
I don't have any regrets
Congrats on nothing!