Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 12:44 20 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : New Program -- 16_Puzzle

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 387
Posted: 06:32pm 24 May 2021
Copy link to clipboard 
Print this post

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 States
Posts: 3027
Posted: 11:29pm 24 May 2021
Copy link to clipboard 
Print this post

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 States
Posts: 387
Posted: 12:16am 25 May 2021
Copy link to clipboard 
Print this post

Good work, lizby!

-Bill
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3027
Posted: 12:23am 25 May 2021
Copy link to clipboard 
Print this post

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
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024