Author Topic: Math puzzle game  (Read 4460 times)

0 Members and 1 Guest are viewing this topic.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Math puzzle game
« on: January 20, 2020, 01:00:17 pm »
I enjoyed a popular online math puzzle game so much I decided to code something like it on my ipad.  I converted the ipad code to QB64 and here's the result.  You move the numbered blocks together so that they touch enough other blocks to turn them green.  The number inside tells how many block they need to be touching.  Touching too many turns them red.  Turn them all green to advance levels (or use left/right arrows to cheat and get to the higher levels).  Source code at bottom.

- Dav

 
NumberTouch.jpg


 
« Last Edit: January 20, 2020, 01:03:30 pm by Dav »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Math puzzle game
« Reply #1 on: January 20, 2020, 05:35:07 pm »
Another A+

Dav, you sure find some interesting puzzles!

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: Math puzzle game
« Reply #2 on: January 20, 2020, 08:39:08 pm »
hi Dav
very well done, but I am having a problem figuring this game out :)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Math puzzle game
« Reply #3 on: January 20, 2020, 10:05:12 pm »
hi Dav
very well done, but I am having a problem figuring this game out :)

If I may be of assistance, if tile has 1 then only 1 tile can be side by side with it, if it has 0 then it must be diagonal to any tile near it, they can touch at corners but not along sides. 3's have to have 3 tiles along it's 4 sides so they wont work in corners.

Hope this helps.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Math puzzle game
« Reply #4 on: January 21, 2020, 08:18:55 am »
Thanks for the A+, bplus!

Jack, here's an image that may help explain the game.  The goal is to put the blocks together, side by side, until they all turn green.  Each block has a number. That number means how many blocks that block must touch to turn green.  Blocks with a 1 have to touch 1 other block to turn green.  Blocks with a 2 have to touch 2 other blocks, etc.  Touch too many other blocks, then the block will turn red.

In the example image below, you see in the first part that no blocks are touching others.  In the second part, they are all turned green because the blocks with 1 are all touching 1 block (the 4 block in the middle), and the 4 block has 4 other blocks touching it (the four 1's) so it turn green too. All blocks are green, level done.

Thanks for checking out the game!

- Dav

 
NTHelp.jpg

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: Math puzzle game
« Reply #5 on: January 21, 2020, 08:36:40 am »
thank you Dav and bplus for the explations, this is an A+ game :)