2022 Developer Survey is open! Take survey.

New answers tagged

0 votes

Hash game in C optimization

I'm just going to put this here, mostly to illustrate that there are different approaches to solving the problem. The OP asked to 'compress' the code, which perhaps means to make it more succinct, or ...
user avatar
0 votes

Hash game in C optimization

Use a function - this will improve readability: D Think about the separation of functions for the player and pc. ...
user avatar
3 votes

A Simple Tic-Tac-Toe Game

You definitely need more functions. You state that you could put print(display_table) in a function, but not sure how you could update the table since it would be a ...
user avatar
  • 30.4k
5 votes

A Simple Tic-Tac-Toe Game

General Style Add a main guard This convention is specific to Pyton. Use a block if __name__ == '__main__': to put all your main logic into. Functions should do one ...
user avatar
11 votes
Accepted

A Simple Tic-Tac-Toe Game

Put all code in functions. This is what experienced programmers do, so you would be wise to adopt the practice even if you don't fully appreciate all of the reasons yet. After that change, you'll end ...
user avatar
  • 9,585
2 votes
Accepted

Tic Tac Toe Module in Rust: Implementing "new"

Just put it in a local value for brevity. That's it. ...
user avatar
3 votes

Tic-Tac-Toe vanilla JS Pseudo OOP

Answering Questions How to implement a MVC pattern? Right now, the state and HTML elements are global variables, but I think this could be stored in state and UI classes Also, I'm having troubles ...
user avatar

Top 50 recent answers are included