r/csharp •
My first little program! It runs you through a simple number trick and tells you if you screw up. New to this whole programming thing, it’s nice to have some working results
[deleted] — view deleted post
0
Upvotes
252
u/Exnixon Mar 30 '20
It's kind of cute that the computer is telling the human to perform computations.
62
u/PM_ME_A_PIZZA Mar 30 '20
Very cool and nice work! Programming is fun.
Let’s do a little social-distancing QA testing: What happens if the number I input is 0? What about -1? How about 2147483647?
14
u/DrSlugger Mar 30 '20
I'd love to break the crap out of this! Good job btw! That feeling of accomplishment is the best!
13
u/[deleted] Mar 30 '20
For anyone wondering, it's 2(x+3)/2 - 3 = (2x+6)/2 - 3 = x+3-3 => which results us with x :)
26
u/0xb1aze Mar 30 '20
f u
17
u/dejco Mar 31 '20
Prtscn - takes screenshoot and sets it to clipboard, use ctrl+v in mspaint to paste it. Alt+prtscn - takes screenshoot of active Windows and sets it to clipboard, use ctrl+v in mspaint to paste it. WinKey+prtscn takes screenshoot of whole desktop and saves it directly to file. Browse pictures folder in file explorer.
5
u/q0099 Mar 30 '20
Glad for you, have a happy coding!
5
u/peetah74 Mar 30 '20
nice job.
5
u/SmithItsGoodForU Mar 31 '20
Where is the “Hello World” part?? I cant find it
3
u/[deleted] Mar 30 '20
Very cool!
3
u/Darioxyzz Mar 30 '20
Cool!
3
u/mikeblas Mar 30 '20
Nice work. It's great to see you thoroughly testing your code, too. Keep it up!
3
u/Poddster Mar 31 '20
Good stuff.
Next step: Make a number guessing hi-lo game.
The computer thinks of a secret random number, then asks the user for input, then says if the input is higher or lower than the secret number. It keeps name/scores in a file across sessions and prints out the current leaderboard after each game.
Fewest number of guesses is the aim.
2
u/vsvasua Mar 30 '20
Reminded me my first programs in Pascal and how my dad reviewed my code, oh that sweet nostalgia feeling.
2
u/Fredric_Chopin Mar 31 '20
I remember school told us Algebra by making solve such problems.
2
u/goingsideways Mar 31 '20
What happens if you enter 0
2
u/hi_im_vash Mar 31 '20
Broke: Write a calculator program.
Woke: Write a program where you are the calculator.
2
u/Azarix Mar 31 '20
Release the code pls :)
1
u/Devcon4 Mar 31 '20
You liar! It clearly says consoleApp2 not consoleApp1! (Also welcome to the club)
1
u/GBACHO Mar 31 '20
Let's see your unit tests
1
u/JKMerlin Mar 31 '20
I have a game I always make on each language I learn, you tell the computer the boundrys and it picks a random number. Then you guess and the computer tells you if you are too high or low. Obviously there is more that can be added to the game, and sometimes I do, (a score for instance) but it's mostly just a good way to practice simple syntax.
1
u/[deleted] Mar 31 '20
Now make it colored and nice.
1
u/tk42967 Mar 31 '20
I did something similar in PowerShell. Have you considered adding validations/default selections for the go again? Maybe make the default yes if the user hits enter.
-6
u/AngularBeginner Mar 30 '20
A good start, keep it up!
I'm sure /u/ketralnis agrees with me!
0
u/[deleted] Mar 31 '20
Eazy
-3
u/Errkal Mar 31 '20
Ew light theme.