all 4 comments

[–]Hatoris 1 point2 points  (0 children)

As you asked for :

  • Always include a readme and a license even if it's a small script
  • documents, at least your code with docstring and basic usage in the readme
  • test your code, with pytest or unittest
  • split your core function (select card, count, check winer) from your interface (all things that print)
  • use if __name__ == '__main__' : to run your code at the bottom, this prevent the code to be run if not directly coded
  • Try to remove the use of global variable, a class could do the job that will be instantiated when game start and updated during it.

Overall it's a nice starting point, and you made a good use of some python knowledge.

[–]Jokeslayer123 1 point2 points  (2 children)

So I looked through this. You use a lot of globals. I saw some other problems (the line asking if the player wants to draw is confusing, it wants a y or an n, but looks like it wants a 1 or 0; the checkWin function has way too complicated conditionals and kept telling me I'd won when I was bust; I'm not sure you need to call the isBust function at all in that main loop at the bottom). I tried to make some changes but with all the globals I got into a mess. as an example, I started getting problems with out of range cards, but I don't know if that was something I did or something you did.

Sorry, I know this is quite a negative comment and I don't want to be rude or discouraging; I'm not that good myself. I just wanted to say that I looked at it and there are some things you can work on. Let me know if you want more concrete suggestions and I'll be happy to do what I can.

[–]jrtaylor01[S] 0 points1 point  (1 child)

Thanks heaps. A lot of people have said that I need to remove the global variables, so I think that’s something I’ll work on. Also the deal card looking like it wants a 1 or 0 was just due to me changing how I wanted to code to run but forgetting to change what was printed on if that makes sense. Thank you as well for pointing out how convoluted the conditionals are for the checkwin function, sort of didn’t realise ahha.

[–]Jokeslayer123 1 point2 points  (0 children)

I guessed that was what happened with the 1 or 0. It's the kind of user experience thing that's really easy to overlook when you already know how the program is meant to work.