TinConsole Demo - KidneyThief/TinScript1.0 GitHub Wiki

This demo is the absolute quickest way to get TinScript up and running. It uses a minimal framework, that includes only a shell to enter commands and output text. For a more interesting demonstration with a framework that uses some minor graphic elements, put together to script an "asteroids" game, see the FLTK Demo.

Build:

  • Download the TinScript 1.0 zip file https://github.com/KidneyThief/TinScript1.0
  • From your TinScript installation, navigate to \\TinScript1.0-master\tinconsole
  • Open the tinconsole.sln, you may have to "Update VC++ Projects" (right-click the solution) for 2012
  • Simply build the solution.

Run the demo:

  • F5 to run the demo!
  • You can also double-click the tinconsole.exe in the same directory as your solution.
  • Remember the language is case sensitive, so for example, execute:
    • Print("Hello, world!");
  • You may also want to run the Unit Tests, by executing:
    • BeginUnitTests();

Implementation

A couple of highlights worth mentioning:

  • TinScript is integrated into this minimal console in four main locations:
    • TinScript::CreateContext(printf, CmdShellAssertHandler, true);
      • Creates the context, and provides two handlers - one for output, and the other for asserts.
    • TinScript::ExecCommand(command);
      • The text string retrieved from the shell is passed to the context to be executed.
    • TinScript::UpdateContext(gCurrentTime);
      • Allows TinScript to keep track of time, so for example scheduled calls can be executed.
    • TinScript::DestroyContext();
      • The demo has been closed, this completely and cleanly shuts down the context.

Enjoy!
⚠️ **GitHub.com Fallback** ⚠️