[Coco] Example basic code for screen grid

Andrew keeper63 at cox.net
Thu Feb 23 22:40:56 EST 2012


Ok - this is going completely from memory, plus a little help from the 
CoCo 3 Extended Basic manual - but it should give you a start:

10 PMODE 4,1
20 PCLS
30 SCREEN 1,1
40 FOR Y=0 TO 191 STEP 8
50 FOR X=0 TO 255 STEP 8
60 REM LINE(X,Y)-(X+8,Y+8),PSET,BF: REM FILLED WITH WHITE
70 REM LINE(X,Y)-(X+8,Y+8),PRESET,BF: REM FILLED WITH BLACK
80 LINE(X,Y)-(X+8,Y+8),PSET,B: REM UNFILLED (WHITE GRID)
90 NEXT X
100 NEXT Y
110 GOTO 110

I don't know if it works; I don't have an emulator or my machine set 
up... :(

Andrew L. Ayers
Glendale, Arizona


On 02/23/2012 12:54 PM, coco-request at maltedmedia.com wrote:
> Message: 10
> Date: Thu, 23 Feb 2012 14:34:40 -0500 (EST)
> From:haywire666 at aol.com
> Subject: [Coco] Example basic code for screen grid.
> To:coco at maltedmedia.com
> Message-ID:<8CEC079522B4E51-E74-563D4 at webmail-d100.sysops.aol.com>
> Content-Type: text/plain; charset="us-ascii"
>
> I need some example code in basic for coloring the screen black, then creating a grid of sorts where I can turn
> some parts of the screen white or back to black...
>
>
> Ideally this should work on a coco1,2, or 3 because I may just use a coco2 for this hardware project of sorts.
>
>
> I've been away from cocos for very long, so I'm still struggling to get what I want, which would be small squares
> on a grid of sorts turning from black to white. I need to control the dots on the grid individually. They would all normally be
> black but white would be "on" for my purposes.
>
>
> Any suggestions of advice, I'm all ears... Ideally, I'd like a grid with 24 or so squares I could turn from black to white and vice versa.
>
>
> Best regards,
>
> Steven



More information about the Coco mailing list