scene.org File Archive

File download

<root>­/­parties­/­2021­/­vintagecomputingchristmaschallenge21­/­challenge/julgran-mc10.zip

File size:
3 550 285 bytes (3.39M)
File date:
2021-12-25 12:55:53
Download count:
all-time: 12

Preview

  • julgran-mc10/julgran-mc10.bas 655B
  • julgran-mc10/julgran-mc10.diz 1.85K
  • julgran-mc10/julgran-mc10.mp4 3.48M
  • julgran-mc10/JULGRAN.C10 878B
  • julgran-mc10/julgran0-mc10.bas 248B

file_id.diz

Author: Anders Carlsson <anders.carlsson@sfks.se>
System: Tandy TRS-80 MC-10
Language: Microcolor BASIC 1.0 (Microsoft 1982, built-in)
Source code: 655 bytes unoptimized
Executable code: 878 bytes (C10 emulator file)

How to run:

1. Locate a MC-10 emulator like VMC-10
2. Type CLOAD and press return
3. From the File menu, choose Play Cassette File and attach C10 file
4. Type RUN to start the program

What the program does:

It displays the Christmas tree. Each time you press a key, it rotates
the matrix by pi/8 or 1/16 of a complete 360 rotation. At least for
the four rotations which are multiples of 90 degrees it displays the
tree mostly OK, for the inbetween rotations it looks a little funky.

How the program works:

First the tree is defined in plain DATA statements with asterisks for
the active points. It is read into two matrices with X and Y coordinates
for each point.

CX and CY are meant to be the pivot point of the rotation, relative to
the 17x11 matrix in which the tree is defined.

AG is the current angle of rotation in radians.

For each rotation, all points are traversed and a transposed point
is calculated using COS and SIN per standard rules:

X1 = X0*COS(AG) - Y0*SIN(AG)
Y1 = X0*SIN(AG) + Y0*COS(AG)

In order to get rounding correct, 0.5 is added to both (+2 to offset
the three vertically). As long as the point is within displayable area,
it is plotted using PRINT@ which has to be followed by ; in order to
not break the line.

After all points are traversed, it waits for a keypress, adds pi/8 and
plots the tree again.

Since this program does more than display the tree in the standard view,
it probably should go into the category of Variation 2.

As a bonus item, a different implementation "julgran0-mc10.bas" is
included. It simply displays the Christmas tree but draws it from
the inside out.