Skip to content
This repository was archived by the owner on Mar 22, 2019. It is now read-only.
/ BPL Public archive

Basic-like programming language interpreter and editor written in java

Notifications You must be signed in to change notification settings

Hitonoriol/BPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BPL

BerNardEr Programming Language interpreter

Interpreted programming language. IDE includes documentation.

Programs can be also run from terminal with "java -jar BPLVM.jar program.bpl"

Functions:

Operator Alias Description
set("var","value") =("var","value") Sets variable to value or to another variable. Always needs quotes in first case.
inc("var") ++("var") Increments int var
dec("var") --("var") Decrements int var
+("var1",var2) var1+=var2
-("var1",var2) var1-=var2
/("var1",var2) var1/=var2
*("var1",var2) var1*=var2
print(var) pt(var) Prints text. No quotemarks needed for variables, but needed for strings.
concat("var1",var2) ct("var1",var2) Concats two strings
wipe() refreshes all buffers and resets interpreter
in("var") gets data from keyboard to variable
showform() sf() shows graphics window, required operator before any other graphic ones
setformsize(width,height) sfs(width,height) sets window size
die() exits program
drawrect(x,y,w,h) dw(x,y,w,h) draw rectangular
fillrect(x,y,w,h) fw(x,y,w,h) draw filled rectangular
setcolor(r,g,b) sc(r,g,b) set color
drawtext(var,x,y) dt(var,x,y) draw text
drawline(x,y,x1,y1) dl(x,y,x1,y1) draw line
repeat(x); ... endcycle(); repeats x times
if(var1,"= or > or <",var2); ... endif(); logical operator
sleep(val) sleeps for val milliseconds
fillscreen(r,g,b) fills entire window with color
cls() clears screen and graphics buffer
goto(val) sends interpreter to val expression(!) not the code line, so it's recommended to use newlines properly
loadpic("picID","filename.png") loads image to memory
loadpic("picID","filename.png") loads image to memory
drawpic("picID",x,y) draws image by id
drawoval/filloval(x,y,w,h) draws or fills oval
readfile/readfilenobr("variable","filename") reads file contents to variable; nobr version doesnt read newlines
getnetresponse("variable","http://webaddress.com") reads webpage to variable
writefile("file","data") writes data to file
title("titletext") changes window title
noresize() makes window non-resizable; when repeated, reverses current state
rnd(min,max,"var") sets var to random value between min and max
label("text",x,y,w,h) places scrollable label with text wrap on form
textfield("var",x,y,w,h) places textfield on form. var is a variable in which text from textfield will be placed
placebutton("text","isPressedVar",x,y,w,h) places a button; when pressed, sets variable isPressedVar to 1
time() unix timestamp

Reserved variables

Variable Description
pkeycode/pkeychar Keycodes or chars of pressed keys
rkeycode/rkeychar Keycodes or chars of released keys
clickx/clicky Mouse click coordinates
mouseinwindow 0-mouse is out of window, 1-mouse in window

About

Basic-like programming language interpreter and editor written in java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published