Skip to main content

New answers tagged

3 votes
Accepted

Dial up some obscure stats for the Chutes and Ladders game

CLI --help import argparse This works. And it's "batteries included". But consider doing "import typer" followed by ...
J_H's user avatar
  • 25.7k
3 votes

A tic-tac-toe game in C

Goto Considered Harmful With goto, you have stumbled into one of programming's oldest debates (and potentially one of its oldest memes!): if and when ...
Kaia's user avatar
  • 131
18 votes
Accepted

A tic-tac-toe game in C

Unfortunately, it seems like you have stumbled across an older version of The C Programming Language which described a dialect of C now dubbed K&R C. K&R C was superseded by ANSI C (C89), and ...
Rish's user avatar
  • 2,286
6 votes

A tic-tac-toe game in C

Advice I - stdio.h: I was able to compile your code in Visual Studio only via adding #include <stdio.h>. Please, add it to ...
coderodde's user avatar
  • 28.3k
3 votes

2D tile map game: Calculate room tiles a furniture item was placed at

The "big 4" directions are typically called Cardinal directions. The next 4 are "intercardinal" directions, sometimes called Ordinal directions. I suggest you create a separate ...
aghast's user avatar
  • 12.4k
1 vote

Text-based tic-tac-toe in bash (continued)

It is easy to understand the user prompts when running the code -- and fun, too. Here are some minor suggestions. When you described the game as "two-player", I assumed I would be playing ...
toolic's user avatar
  • 3,375
2 votes

My first code: Blackjack game

Usage You made it easy to run the code, and following the input prompts is simple. It is very convenient for the user that you accept upper-case or lower-case "y" for input. Simplify There ...
toolic's user avatar
  • 3,375
1 vote

OOP Blackjack in Python 3.9.9

You did a good job partitioning the code into files and classes. Many of the classes, functions and variables have meaningful names, and many of the docstrings are helpful. Here are some adjustments ...
toolic's user avatar
  • 3,375
3 votes

Text-based blackjack in python

cryptic index deck = [(value, suit) for ... ] def card_points(card): if card[0] in ['Jack', 'Queen', 'King']: return 10 elif card[0] == 'Ace': The ...
J_H's user avatar
  • 25.7k
2 votes

Text-based blackjack in python

Overview You've done a good job: You leveraged code written by others with the import Used meaningful names for many of the variables Here are some adjustments ...
toolic's user avatar
  • 3,375
2 votes

Space shooter game using pygame

In addition to the previous thorough answer, in the things.py code, you could reduce repetition in creating the lists of file names using a loop in a function. <...
toolic's user avatar
  • 3,375
9 votes
Accepted

Space shooter game using pygame

The graphics are beautiful. I appreciate the attention to details, like the background stars. assets directory This certainly is not bad: ...
J_H's user avatar
  • 25.7k
5 votes
Accepted

Text based tic-tac-toe in bash

The intent here is that an engineer who is not a Bash expert should be able to readily maintain the code some months down the road. I do not know much about bash You might be that future maintenance ...
J_H's user avatar
  • 25.7k

Top 50 recent answers are included