Some more fun with Hello World
$ cd ~
$ mkdir futuro
$ cd futuro#include <futurocube>// Initialize variables to be used later on new c new j new cursorSide new square = 0 // Set a green 'M' as the icon new icon[] = [ICON_MAGIC1, ICON_MAGIC2, 1, 4, cGREEN,0, cGREEN, cGREEN, cGREEN, cGREEN, cGREEN, 0, cGREEN, '''', ''''] main() { // Initialize the icon ICON(icon) for (j = 0; j < 1; j++) { // Change this hex code to try differenct colours SetColor(0x00FF0000) // Get cursor lets the RFC know which square is at the top c = GetCursor() // _side finds the side that the square passed to it is on cursorSide = _side(c) for(;;) { // Calls the function declared below lightSide(cursorSide, square) // Delay enables you to see the squares lighting up - otherwise, they will be too fast to see! Delay(50) // Changing the square for the next lighting up function call switch (square) { case 0: square = 3 case 1: square = 4 case 2: square = 5 case 3: square = 6 case 4: square = 7 case 5: square = 8 case 6: square = 1 case 7: square = 2 case 8: { square = 0 if (cursorSide == 5) { cursorSide = 0 } else { cursorSide++ } } } } } } lightSide(side, light) { ClearCanvas() DrawPoint(_w(side, light)) PrintCanvas() printf("side: %d, square: %d\r\n", side, light) }
Last updated