question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description

I would like to make a Sudoku game command for Lancebot. Here are the rules for playing Sudoku, in case you don’t know: https://sudoku.com/how-to-play/sudoku-rules-for-complete-beginners/

Reasoning

Sudoku is one of the most popular puzzle games in the world currently and it provides a good challenge for your brain.

Proposed Implementation

  • The bot will print an embed with a 6x6 Sudoku board, like so: image
  • The grid will have the columns numbered and rows alphabetized, like so: image
  • User will simply enter their input for the game by typing the coordinates of the square that they want to enter a number in (ex. A3), then the number they want to input (ex. 8). So in this case, what the user would type is: A3 8. If the user guesses correctly, then the bot will automatically update the original embed with the correct guess added. If the user wishes to edit their guess, they may do so by simply editing the message. If the user wants to remove a number from a square, they can type something like this: A3 X.
  • Make 2 buttons, one called “Hint” and the other “Give Up”. I think it’s obvious what I want those buttons to do 😃
  • To avoid spam of the “Hint” button, I’m going to record the last time the button is pressed using the built-in time module in Python and count 3 minutes from that time and after that time elapses, allow the user to click that button again. Then the process repeats.
  • I am also considering the possibility of the bot generating puzzles with multiple or no solutions. The way I’m going to prevent this from happening is by using the backtracking method. I did some research online and I will be using this website as a guide.

Would you like to implement this yourself?

  • I’d like to implement this feature myself
  • Anyone can implement this feature

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
DMFriendscommented, Feb 6, 2022

Ok, so based off this discussion (starts there), I have (hopefully) made my final decisions as to how I (and others) want this implemented.

  • Instead of a 4x4 (or 9x9 for that matter), I will be making a 6x6 grid generator instead
  • I will not be adding the embed that says whether a user’s input is right or wrong
  • I will also be numbering each column and alphabetizing each row as shown below: 147312131-a3ed5447-d75d-466f-a3a5-ad2a6124b08a That way, I can make it so that user can guess by entering something like B6 8. If the user wishes to edit their guess, they will simply edit the message with their guess. If they wish to remove a number from the board, the user would edit the message to say B6 X.

I believe those are the main takeaways from that conversation I linked. @onerandomusername @Sn4u Let me know if I missed anything.

Lastly, just to make sure: @jb3, do you still approve of this happening with those changes I mentioned above (in this comment)?

1reaction
onerandomusernamecommented, Dec 20, 2021

What about an image of the board that we edit every time the player makes a move? Could be done with PIL

See https://github.com/python-discord/sir-lancebot/pull/956#issuecomment-997322591

I’m not familar with PIL myself, either

Read more comments on GitHub >

github_iconTop Results From Across the Web

I have created a program to play sudoku in the command line!
This is a place to learn and discuss Sudoku puzzles. ... I have created a program to play sudoku in the command line!...
Read more >
ObliqueMotion/sudoku-cli: A Command Line Tool For ... - GitHub
A command-line tool for solving sudoku puzzles. Install by running: cargo install sudoku-cli; If your input is a file path, sudoku-cli will read...
Read more >
Sudoku - the Tcler's Wiki!
(bernard-01-12-2005) It is a command line sudoku solver written in Tcl and named sudokut. There is no GUI: just pass the sudoku 81...
Read more >
Nudoku | ncurses based sudoku game
Nudoku. Sudoku for your terminal. a game. Can't code? Can't hack? Can't do anything cool on the command line? This game will give...
Read more >
Sudoku command line solver download | SourceForge.net
Download Sudoku command line solver for free. Solve 9x9 Sudoku Puzzles Using A Command Line Utility. This tool written in C uses the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found