![]() |
Forum Index : Microcontroller and PC projects : New Program -- 16_Puzzle
Author | Message | ||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Here's a new program, the "16 Puzzle". Your task is to assemble the 16 pieces so that they fit into the square frame with no gaps or overlaps. You can choose from 4 levels of difficulty. Enjoy! -Bill ![]() 16_Puzzle.zip |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3309 |
Nice. Also, for once, trivially easy to port to the Armmite F4. While the CMM2 implementation can use a mouse, everything can also be controlled from the keyboard. But it was set up to use a plugged-in USB keyboard, not the PC console. So I replaced all instance of inkey$ with _inkey$(), and added this function: Function _inkey$() local ky$ ky$=inkey$ if asc(ky$)=27 then ' escape sequence ky$=inkey$: ky$=inkey$: ky$=ucase$(ky$) If ky$="A" Then: ky$= chr$(UP) ' chr$(128) ' up arrow ElseIf ky$="B" Then: ky$= chr$(DOWN) ' chr$(129) ' down arrow ElseIf ky$="C" Then: ky$= chr$(RIGHT) ' chr$(131) ' right arrow ElseIf ky$="D" Then: ky$= chr$(LEFT) ' chr$(130) ' left arrow ElseIf ky$="1" Then: ky$= chr$(HOME) ' chr$(134) ' home ElseIf ky$="4" Then: ky$= chr$(ENDE) 'chr$(135) ' end ElseIf ky$="5" Then: ky$=chr$(136) ' pgdn ElseIf ky$="6" Then: ky$=chr$(137) ' pgup ' Function keys are ??? EndIf endif _inkey$=ky$ end function This has the advantage of also allowing it to run on the CMM2 with PC console and VGA output to VGA-HDMI converter and HDMI-to-USB3 with Windows camera. ![]() I did not run it through all its paces, so there may be something missing. Armmite F4 on Fruit of the shed PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
Good work, lizby! -Bill |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3309 |
Thanks, Bill. This is a large and complex program you have provided--over 1200 lines. It's a tribute to your work and to the design and extension of MMBasic that by making a single change (replacement of a built-in function with a custom one on 10 lines) and adding 19 lines, it works on an entirely different hardware platform. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |