Share your repls and programming experiences

← Back to all posts
Haiku Simulator
Pinhead69

This is just something I made to escape the plague of boredom
Any criticism/comments/ ideas will be looked at and appreciated :D
(REVAMPED: MORE OPTIONS FOR HAIKU)

Voters
incognitocoder
Jbogovic
LordPancake
WyattKeenan
eccoder
Clementsaic
sErn
BenjaminSmith5
slimywaterfalls
cumberland
Comments
hotnewtop
sErn

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:

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

@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

The haiku sounds like something that could happen.

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

Pinhead69

@LordPancake We live in a society

AidenPython

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

Bipolar?

Pinhead69

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

AidenPython

@Pinhead69 Ha ha, yeah.

amasad

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

I feel bullied.

Pinhead69

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

Zavexeon

Is that a threat? :o

Pinhead69

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

Zavexeon
Pinhead69

@Zavexeon Not the BanHammer lmao

PhoenixSaid

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