Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
Does hangman game needs a database?

I am trying to design a hangman game in lucidchart. Just start to thinking about the data. If I decide to store them in database, what kinds of columns do I need?

I can think of columns:

(1) word: To store the actual word; (2) numberOfWrongGuesses: To store the wrong guess number (3) currentWord: The word currently has guessed etc.

One problem is once the user done the game or prepare to start a new game, the database needs to be cleaned up right?

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

If I decide to store them in database, what kinds of columns do I need?

It depends on how you want the game to work, not just gameplay (guessing the current word) but also managing what happens once the current game is finished - did you want to keep score, etc?

I don't know how Lucid chart works (what sort of runtime, API and programming environment it supports; or how users will interact with it, can it maintain state, etc), but you may be able to run the game entirely in-memory and not need a database at all.

Before diving straight into the physical columns, do a logical design on paper or a whiteboard.

One problem is once the user done the game or prepare to start a new game, the database needs to be cleaned up right?

That also depends on how you want the game to work. It also depends how many people will be playing this - if two people play it at once, they'll need their own separate set of data.

Cleaning up the data helps keep the database size smaller over time, but it also means you wouldn't be able to track a players history, or allow you to see things like "hardest 5 letter words of all time" etc.

about 4 years ago · Juan Pablo Isaza Report

0

Not necessary, you can create a js file with let object like this:

data.js

const words = [
    { id: 1, name: 'spring' },
    { id: 2, name: 'promise' },
];

after you import this file to your html file.

about 4 years ago · Juan Pablo Isaza Report

0

In general: Start with an analysis of what you want the application to do. Only after that, you can decide if you need persistent storage, and if a database would be the best persistent storage for your application.

Note that databases are used for persistent storage. Since you are thinking about wiping the database after each game, this makes me think you do not need a database.

In this case, I think that you might not need any storage at all. Since you mention Javascript, you might be building a game that runs in the browser. Perhaps cookies would be enough to keep track of the score of your user.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!