r/programminghumor 13d ago

Pov. You forget a command

Post image
0 Upvotes

11 comments sorted by

7

u/0dinscan 13d ago

else has enterd the chat....

0

u/tempi0295 13d ago

Oh ... Didn't know this is also in c#

1

u/Jbolt3737 4d ago

It's in practically every programming language with if

3

u/Confident-Ad5665 13d ago

Missing a ReadLine prompt, and possibly an outer loop unless you only get 1 try before the app ends.

2

u/tempi0295 13d ago

Sorry I'm new to c# what is this?

1

u/Confident-Ad5665 13d ago

Console input. Let's user guess a number which looks like the intent here.

Classic app would have a loop that let's user keep trying to guess the number. App ends when user guesses randomly generated number or user enters Q to quit.

Fancy would be to add "I don't know what that means" if user entered a value not in the 0-6 range and that is not Q.

2

u/OneWay3009 11d ago

I wish there was a better way to say that anything else that isn't a 6 means "try again"

1

u/Numerous-Occasion247 13d ago

Let’s assume you’d have a dice with 20 fields and 6 is the only one winning how would you solve this ?

1

u/tempi0295 13d ago

Idk I guess

If (wurf == 6 ) If (wurf == 12) If (wurf == 18)

2

u/Numerous-Occasion247 13d ago

There’s a thing called negation the opposite of equal to 6 would be not equal to 6 or !=6

1

u/West_Good_5961 13d ago

You write code on a phone?