thibaudcathala / my_numworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

my_numworks - NumWorks Emulator on Unity

Numworks is a graphical calculator where you can write python like program to create graphical experience only by modiffing the color of the pixel of the screen and getting the color of a pixel. The screen resolution of the numworks is 320x222 pixels.

How to use

  1. clone the repository
  2. launch the unity project

image

  1. Now that you have launched the project you can :
  • launch the emulator and execute an example program

image

  • create a new script in the Programs folder and code your own program that you can execute by launching the emulator and selecting your program in the menu

image


How to create a simple program

  1. create a new .cs script
  2. remove the default content of the public class of your script :

image

  1. now that you have and empty program copy past this code snippets in your program :
void Start()
{
    StartCoroutine(main_func());
}

IEnumerator main_func()
{
    // code here
    yield return null;
}
  1. you can now code in the "main_func" that you can rename if you want, the line yield return null; is there to control the flow of the program
  • You can use :

yield return null;

To pause the program and continue in the next frame

yield return new WaitForSeconds(2f);

To pause the program for 2 seconds

yield break;

To completly end the program

take a look at the default program included in the progect to see how to use the in real case


How to use Default Module

  • With the emulator is given 3 default module that contain multiple function for different purpose :

    • kandinsky
    • math
    • random
  • to import those module you have to simply put those line at the top of your program :

    image

  • and then use modules :

    image


Example program

There is 2 example program for now

Mandelbrot

This is a program that draw the mandelbrot fractal

image

Clock

This is program that draw a clock showing the current hour, minute and seconde

image

About


Languages

Language:C# 100.0%