[Coco] Example basic code for screen grid

Andrew keeper63 at cox.net
Fri Feb 24 23:59:27 EST 2012


> Message: 1
> Date: Thu, 23 Feb 2012 23:38:52 -0500 (EST)
> From: haywire666 at aol.com
> Subject: Re: [Coco] Example basic code for screen grid
> To: coco at maltedmedia.com
> Message-ID:<8CEC0C5580EBAED-1118-76583 at Webmail-d107.sysops.aol.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Andrew, yes it works. Thats almost exactly what I need but I need no white outline around the grid and
> I need about 1/4 of the squares as you have here. Like it needs to be about 1/4 of the squares and bigger.

Try this for fewer squares (I just modified the step rate to be 4 times 
larger, so the grid s/b 8 x 6 now):

10 PMODE 4,1
20 PCLS
30 SCREEN 1,1
40 FOR Y=0 TO 191 STEP 32
50 FOR X=0 TO 255 STEP 32
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'll play with this and see what I can do. Thanks so much thats pretty impressive you did that from memory!
>
> Also, Can I get this to be black bordered instead of white bordered?

By "white bordered" do you mean the "thick white" surrounding border on 
this screen? If so, I don't know off the top of my head how to do this; 
I think it is a special POKE or something - maybe someone else has an idea?

If you mean something else, let us know!

> Thanks so much for a fantastic program!

You're welcome!

> This is for an idea I have for home automation using the coco. The screen will be attached to a board that sits in front of
> the monitor and has photocells. To turn something on, the square on the screen corresponding to each photocell can be turned
> on (white) or off (black)

Hmm - are you expecting there to be user input or such on the screen? 
What controls the squares turning on/off? If you need on-screen user 
input, then the above would require a ton of extra work (you'd have to 
create a graphical font using DRAW statements, plus create a custom 
input polling routing using INKEY$ in a loop, plus some other 
modifications); not impossible, but more than just the above simple 
script...

> Any help getting this program to be black bordered and larger squares would be great appreciated! I think 64 squares total on
> the screen would be all I can get with the size or average small photocells. I really want to get this to work I'm sure I can build all the
> photocell circuits but the software side, I've been away from coco too long!

Let us know what you mean exactly (re: my questions above), and I am 
sure something can be figured out... :)

Andrew L. Ayers
Glendale, Arizona



More information about the Coco mailing list