Hello people, I need an idea with u. I need to draw a grid 10 by 10 and then randomnly fill it with numbers, operators + - and =. then user will need to swap number or operator or equal sign to make matches like this 2+3 = 5. It can be horizontal match or vertical matches. I need to do it in javascript. Can someone give me an idea how i can proceed? only idea not code. My point is i need to fill the grid randonmly and make sure that there is some matches in the grid in the wrong order like this : 2 3 + = 5. Then user will be able to swap the + to make a match.
techyworld
0
Junior Poster in Training
Recommended Answers
Jump to PostYou need to decide whether the grid is pre-draw or not. If it is pre-draw (inside HTML), then you could use the element's ID to manipulate the value inside. For example, you draw your grid using table, so each cell (td) may be given an ID/name as row+"-"+column (i.e. row …
Jump to Postfirst create those equations randomly.
Lets say 1+2 = 3
2+3 = 5
3+3= 6you have now all characters: [1+2=32+3=53+3=6]
so those are necesarry. Put them in the table at random places. And then fill in left places with random chars.
Jump to PostAs SPeed_FANat1c said, you need to create your equations randomly and must ensure that your equation is balanced. If you have a pre-drawn table (as I mentioned in my previous post), you then can process as follows...
1.For each row of the table, create a balancable equation. A simple way …
All 9 Replies
Taywin
312
Posting Virtuoso
techyworld
0
Junior Poster in Training
McLaren
3
Posting Whiz in Training
Taywin
312
Posting Virtuoso
Taywin
312
Posting Virtuoso
techyworld
0
Junior Poster in Training
Taywin
312
Posting Virtuoso
techyworld
0
Junior Poster in Training
Taywin
312
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.