#Tried making a coin flip betting program as a first program. How's it look?

28 messages · Page 1 of 1 (latest)

worldly quail
#

I've been coding for about a week to two weeks. It works but not sure how I could do it better.

ivory marten
#

Are you looking for a code review or something specific?

worldly quail
#

review mostly

wispy crag
#

Does it work? If so then congrats!

ivory marten
#

Ight time to shred this code

worldly quail
#

it does, yeah, everything works

ivory marten
#
  • Not a fan of having the multiple Console.WriteLine() calls instead of just using \n in the strings
  • Rest looks ok, what more can I say
worldly quail
#

😭 yeah i need to clean those bad habits it's so messy

#

but thank you! it took a couple hours to figure out Peepo_Dead

ivory marten
#

Code looks okay though, can't really hate much

#

Except for the rainbow tabs

#

I really hate those

worldly quail
#

what could be improved?

#

Peepo_Giggle sorry it makes my brain happy

ivory marten
#

method names seem a bit weird

worldly quail
#

nodcat my naming conventions are shit definitely have to improve

ivory marten
#

Variable names are fine but like

#

CoinFlip() is a bit weird

#

MakeBet is fine, Game() is okay-ish I guess

#

I'd probably call CoinFlip something like PlaySingleRound idk

wispy crag
#

Could you use something other than a try catch inside the coin flip? Like checking user input for valid options using a loop.

ivory marten
#

Or having a funny function that can get a user input as int / whatever

wispy crag
#

If you rewrote that if statement you could only check for 1 condition. If not 1 then you know it’s 2.

#

But really I say it looks fine.

worldly quail
#

but that chunk of code was a pain for me to figure out, but i could try to slim it down! might make it make more sense

#

and thank you candycute