Page 1 of 1

PHP Word Scrambled game

Posted: Mon Mar 02, 2015 8:12 am
by ravinampad
Iam developing a word game . In this , words are scrambled . I have to get jumbled words that should be equal to that of the words in the database. First , I have to get the tile for storing the jumbled words . How get the tile?

Re: PHP Word Scrambled game

Posted: Mon Mar 02, 2015 3:49 pm
by requinix
I don't know what you're asking.

If this is just a game where you show a scrambled word and the user has to put the letters in the right order,
1. Get any word from the database
2. Split the word into individual letters
3. Shuffle the letters
4. Output the letters in the new order
When the user submits a word,
5. Check if the word matches the one you selected from the database

Re: PHP Word Scrambled game

Posted: Tue Mar 03, 2015 1:30 am
by ravinampad
Thats right. The correct words are there in the database. You would get the scrambled words i.e jumbled words .But how to show these words in tiles you see in word games like crossword games.

Re: PHP Word Scrambled game

Posted: Tue Mar 03, 2015 2:38 pm
by requinix
You can use CSS to style a SPAN or DIV to look like a tile. Off the top of my head, something like

Code: Select all

.tile {
  display: inline-block;
  width: 4em;
  height: 10ex;
  background: /* beige */;
  color: #fff;
  border: 2px outset #ccc;
  font-weight: bold;
}