Skip to content
Henrik Lievonen edited this page May 1, 2014 · 11 revisions

Eppabasic is a new, simple web based basic language inspired by Coolbasic. The idea of the language is to be as simple to start programming with as possible.

Code editor

The official web site of the language (under construction) contains a web based IDE (also available as downloadable zip) with syntax highlighting, spell checking and documentation with sample programs for every command.

Running programs

The IDE contains compiler which compile the Eppabasic code into native Javascript which is then runned in a separate window. The programs can be shared with other users via the web site of the language, but programs can also be downloaded as single .html files for offline usage.

Graphics

The program uses html5 canvas elements for drawing, possibly with WebGl. It is yet to be desided how this is exactly to be implemented.

Drawing commands

  • LINE x1, y1, x2, y2
  • RECT x, y, w, h
  • ELLIPSE x, y, w, h (x and y being the center of the ellipse)
  • TRIANGLE x1, y1, x2, y2, x3, y3

Audio

Eppabasic supports loading audio from files and playing it back via Javascript Audio object, with html audio element as a backup implementation.

Desing goals

  • Simple to start programming with
  • Easy to make graphics
  • Works everywhere
  • Copied code works without any other tweeking (no compiler settings)

Syntax

This is a simple code to show off a syntax proposal. It is yet to be decided weather keywords and function names should be with capitals (eg. IF, ADDTEXT) or with CamleCase(eg. If, AddText).

DIM a AS INTEGER = 10
DIM b AS INTEGER = 20
DIM c AS INTEGER = (a + b) * a

ADDTEXT 10, 10, STR(c)
IF a > b AND b < c THEN
    FOR i = b TO a STEP -2
        LINE 10, 30, TEXTWIDTH(STR(c)), 30 + i*20
    NEXT i
END IF

DO
    CLEAR
    ' Stuck here
    DRAWSCREEN
FOREVER
Clone this wiki locally