Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:37 20 Apr 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 : picomite oneliners

Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 07:47am 31 May 2023
Copy link to clipboard 
Print this post

One of the most famous one-liners for C64 lovers is the maze generator, based on alternating / and \ graphics symbols. I tried to mimick this for picomite VGA.

Dim a$(1)=(Chr$(47),Chr$(92)):Do :Print a$(Rnd());:Pause 10:Loop


The "Pause 10" is just to mimick 8bit computer speed....

Volhout
Edited 2023-05-31 17:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 07:50am 31 May 2023
Copy link to clipboard 
Print this post

I thought the bouncing ball (as inspired by Martin H) could be a nice addition.

Do :x=x+a:y=y+b:a=a+(x=0)-(x=79):b=b+(y=0)-(y=38):Text 8*x,12*y,"0":Pause 20:CLS :Loop


For PicomiteVGA. The Pause 20 here is needed to make the ball visible...

Volhout
Edited 2023-05-31 17:52 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 890
Posted: 08:51am 31 May 2023
Copy link to clipboard 
Print this post

  Volhout said  One of the most famous one-liners for C64 lovers is the maze generator, based on alternating / and \ graphics symbols. I tried to mimick this for picomite VGA.

Dim a$(1)=(Chr$(47),Chr$(92)):Do :Print a$(Rnd());:Pause 10:Loop


The "Pause 10" is just to mimick 8bit computer speed....

Volhout

still fits in one Line (in Mode1)
;-)
Clear:CLS:Dim a$(1)=(Chr$(47),Chr$(92)):Do :Print a$(Rnd());:Pause 5:Loop

Edited 2023-05-31 18:52 by Martin H.
'no comment
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 522
Posted: 05:43pm 31 May 2023
Copy link to clipboard 
Print this post

Running this on a RP2040 Zero output to terminal.

Clear :Dim a$(1)=(Chr$(47),Chr$(92)):Do :For n=1 To 80 :Print a$(Rnd());:Pause 5:Next n:Print :Loop


Quazee137
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 04:58am 01 Jun 2023
Copy link to clipboard 
Print this post

You are in a cave, lost.....

1 a=Rnd()*4+1:?"in a cave:"Left$("NSWE",a):Input b$:If b$<>"e" Or a<4 Then 1 Else ?"escape!"


try to get out...

Volhout

P.S. for one-liners the line numbers are nice. They are shorter than do:loop
Edited 2023-06-01 15:01 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 07:58pm 02 Jun 2023
Copy link to clipboard 
Print this post

A complete game in one line......

Based on : C64 oneliner

Try to maneuver your spaceship "V" between the stars "*". For VGA Picomite in mode 1. You start your journey on the left side of the screen. Use left and right arrow to maneuver. Start with right arrow, or you will be flying in another universe...

1 Text 8*c,84,"V":Pause 99:b=Asc(Inkey$):c=c+(b=131)-(b=130):a%=80*Rnd():Print @(8*a%,468)"*":If Pixel(8*c+4,89)=0 Then 1





This version works for all picomites through terminal (tested on Putty). It is slightly longer.

1 Print @(8*c,84)"V":Pause 99:b=Asc(Inkey$):c=c+(b=131)-(b=130):a%=80*Rnd():Print @(8*a%,468)"*":If Pixel(8*c+4,89)=0 Then 1



You can shrink the game to an absolute minimum, but then you exit the game with an error. PicomiteVGA only.

1 Text 8*c,84,"V":Pause 99:b=Asc(Inkey$):c=c+(b=131)-(b=130):a%=80*Rnd():Print @(8*a%,468)"*":GoTo Pixel(8*c+4,89)+1


Happy playing....

Volhout

P.S. the trick is to PRINT a new "*"<CR> at the bottom of the screen, so it starts to scroll. TEXT will not do this.
Edited 2023-06-03 17:42 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 890
Posted: 07:39am 04 Jun 2023
Copy link to clipboard 
Print this post

  Volhout said  A complete game in one line......

1 Print @(8*c,84)"V":Pause 99:b=Asc(Inkey$):c=c+(b=131)-(b=130):a%=80*Rnd():Print @(8*a%,468)"*":If Pixel(8*c+4,89)=0 Then 1



looks like my very first "game" on my 1k ZX81  
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 12:34pm 04 Jun 2023
Copy link to clipboard 
Print this post

Thans for the reaction. I was afraid nobody cared. I hoped this would plant a seed for others to create oneliners. Although it is hard to do something usefull in one line.

Volhout

b.t.w. The version of the game that I suggested would work on all mites... well... you need the VGA software to run it, the PIXEL command does not exist in other MMBasic's.
So ... VGA only..
Edited 2023-06-05 17:10 by Volhout
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3649
Posted: 10:35am 05 Jun 2023
Copy link to clipboard 
Print this post

They look great - sorry I can't try them for quite a while.

John
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3010
Posted: 11:35am 05 Jun 2023
Copy link to clipboard 
Print this post

Thanks for posting those one-liners. They've been fun to try.

  Volhout said  the PIXEL command does not exist in other MMBasic's. So ... VGA only..


PIXEL command exists in Picomite, Micromite, Webmite, CMM2, F4, MMB4W (just the 'mite manuals I had open).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 11:57am 05 Jun 2023
Copy link to clipboard 
Print this post

  lizby said  Thanks for posting those one-liners. They've been fun to try.


  Volhout said  the PIXEL command does not exist in other MMBasic's. So ... VGA only..


PIXEL command exists in all Picomite.

But the game relies on using the print "*"<CR> function on the active screen to scroll the screen.
In Webmite you can create a virtual screen, but can write only using the TEXT command. The PRINT (that causes the screen to scroll) does not work on the virtual screen in webmite.

This may be similar for the LCD screens. Maybe if you do something with OPTION CONSOLE it may...

For now this one-liner game only works on VGApicomite. Sorry...

Volhout
Edited 2023-06-06 19:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 07:54am 09 Jun 2023
Copy link to clipboard 
Print this post

Can one of you recommend a MODE in MMB4W so I can actually type it in one line?

I seem to have tried all 13 Modes and still can't fit some of those oneliners.
I'd give my left arm to be ambidextrous
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 08:43am 09 Jun 2023
Copy link to clipboard 
Print this post

Hi Ian,

These oneliners shown are working on picomiteVGA. PicomiteVGA has MODE 1 where you have 80 characters on one line.
In the editor you can type up to 80 characters
then you continue on the next line

Once done (you may have type in total 120 characters), you go to the beginning of line 2, and <BACKSPACE>.
Line 2 will then (invisible) be appended to line 1. So it is a single line.....


The one-liner-game (spaceship, rockets) you can paste the long line (just select all and paste) into MMB4W, but it does not actually work. The one-liner checks the content of a pixel, and is based on the font used and color attributes. That may be causing it.

The other 2 (cave and maze) work fine in MMB4W.

Volhout
PicomiteVGA PETSCII ROBOTS
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 10:49am 09 Jun 2023
Copy link to clipboard 
Print this post

It shouldn't matter soon as my VGA picoMite will be done..
Trying to sort out the sound.

Using the dac method but I was unsure of how to configure the SPI.. It looks like I have to do the same as the LCD on the normal PicoMite and make it a "system" SPI.

I think it needs to be connected to the SD and the PS2 keypad??
I'd give my left arm to be ambidextrous
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 11:32am 09 Jun 2023
Copy link to clipboard 
Print this post

  IanRogers said  It shouldn't matter soon as my VGA picoMite will be done..
Trying to sort out the sound.

Using the dac method but I was unsure of how to configure the SPI.. It looks like I have to do the same as the LCD on the normal PicoMite and make it a "system" SPI.

I think it needs to be connected to the SD and the PS2 keypad??


I think the audio has it's own SPI channel or SPI pins. That is because it needs to be "real time", other than the SD card and LCD. The VGA picomite does not have a "SYSTEM SPI". It has a PS2 interface, an SD card interface, a VGA interface, and an AUDIO interface. All independent pins.

You specify what pins with OPTION AUDIO SPI GPx,GPy,GPz

Volhout
Edited 2023-06-09 21:34 by Volhout
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3010
Posted: 11:58am 09 Jun 2023
Copy link to clipboard 
Print this post

  IanRogers said  Using the dac method ...

Which DAC are you using? Please report on your success.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5705
Posted: 12:14pm 09 Jun 2023
Copy link to clipboard 
Print this post

The DAC does need its own SPI channel, but MISO isn't used. That pin appears to be free to use for anything else.

The DAC chip is the MCP4822 family. That particular version is 12-bit but there are a couple of lower ones in the family. It's the one that Peter used on his latest surface mount VGA board.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 12:42pm 09 Jun 2023
Copy link to clipboard 
Print this post

I'll replyin my VGA thread as this is for oneliners.
Volhout will think me rude!!
I'd give my left arm to be ambidextrous
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 09:50am 21 Aug 2023
Copy link to clipboard 
Print this post

Grafiti...Just for fun. VGA pico only....

Function r(a):r=a*Rnd():End Function :MODE 2:Do :Colour 0,r(2^24):Print @(r(312
),r(224))" ";:Loop

Edited 2023-08-21 19:55 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Print this page


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

© JAQ Software 2024