Haiku Simulator
Pinhead69 (16)

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

You are viewing a single comment. View All
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 (16)

@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