Hex Game Grid [intermediate challenge]

This is where most of us started. Classic Spectrum basic.

Moderator: Programming Moderators

Post Reply
User avatar
Brayn-3
Posts: 14
Joined: Thu Jun 01, 2017 7:15 pm

Hex Game Grid [intermediate challenge]

Post by Brayn-3 » Sat Jul 01, 2017 1:40 pm

Many games use hexagonal grids in contrast to the square grid. In this challenge we want to be able to paint the fields of a hex grid in any of the eight colours.

Rules
- A subroutine fills one hexagonal field at (x,y) with a given colour c.
- Paint the hexagons in the given sequence (see picture 1) by calling the subroutine.
- The program has to end with GOTO 1E4 (go to line 10000).
- Use the coordinate system from the 2nd picture.
- All hexagons have the same height and width.
- The hexagons may be streched to fit in the square grid.
- EDIT: To make it easier, only the top 22 rows (or 176 px) have to be used
- The person with the shortest source code wins (see link below).
- The challenge ends Sunday, midnight.

Have fun! :-)
Hex-Grid-2.png
Hex-Grid-2.png (3.95 KiB) Viewed 1054 times
hex-coord.png
hex-coord.png (7.74 KiB) Viewed 1067 times
measuring method
Facebook entry

Post Reply