Piki
A scripting language.
Piki originally began as a 24.5 KB QBASIC file in January-ish 2004. The name came from a blending of BASIC and 3DR BUILD control code that I tended to scribble in—
'-= SyconeoNi Technologies Corporation =-
'## # ## #
'# # ## ## # # ## # # # ## ##
'## # # # # # # # # # # # # # # # #
'# # ## # # # # # # # # # # # ##
'# ## ## ## ## # ## # ## ##
' Programming Language Interpreter
The idea was that, simply put, I was sick of a couple of the limitations of QuickBASIC and wanted to be able to do more with it. I could have, easily, by picking up a few manuals about assembly, but I'm more of an Emacs user than a vi user, so rather than ascend, I recursed, and this came out.
Piki is structurally a very strange language. It appears on the surface almost exactly like lower-case BASIC, though @ signs are used to denote labels, and there are other weird things going on:
// Piki Dice
//
// (c) SNTC, 20040406
echo "QUIT to exit."
@start
dice = get("Roll: ")
if lcase(dice) = "quit" then goto "end"
count = int(left(dice, instr(dice, "d"))); // Troubles getting it to work quite right.
size = right(dice, (len(dice) - len(count)) - 2)
max = 0
pass = 1
@loopy
val = int(_rnd * size) + 1
echo val; max = max + val
pass = pass + 1
if pass > count then goto "happy"
goto "loopy"
@happy
echo "Total: " & max
goto "start"
@end;;
There are several major dialects of Piki, based on what application it was tweaked for. Leaflet is technically a dialect of Piki—the original QBASIC versions of both were almost perfectly code-compatible—but it has a significantly improved (but slower) internal structure, and so I generally regard it as a separate development.
One thing that consistently plagued Piki interpreters were fencepost errors that I never bothered to resolve. Both linebreaks and semicolons are regarded as line terminators, and so files were frequently littered with extra semicolons to cause delays. Little optimisation was present.
Piki was also fairly notorious for being awful about global variables. (I was pretty young.) As a consequence porting it out of QBX was really painful.
Anyway, I wrote two major programs using Piki before I wrote Leaflet and swore I'd never write another function wrapper that required me to calculate the length of the function name in order to make the instruction work properly: Rockman VI, and Cordicom Telerin. I didn't get away from calculating lengths, however—although Leaflet was written in November 2004, development on Telerin continued into 2009!
Piki applications and sub-projects
- Rockman VI
- Artland
- Artville
- Artworld
- LNDPlanner
- tArtland
- Telerin
A multitasking Piki executive for Windows.