Menu

TableScript Alpha 4 Released

TableScript Alpha 4

This is the fourth release of TableScript, and I'm starting to be real happy about the state of things.

Building

Do a 'make' to build the interpreter (ts), then run a table:

ts tablefile.ts

State Of Things

The major problem remaining is the memory stuff. It's handled in some places, but neglected in others. The next step will be to standardize it across the code. Plus, I really need to sort out how external add-in modules are going to work. Expect that in the next release.

Have a look in the tables directory for some examples of what you can do.

Changes

Alpha 4
- Complex dice descriptors. You can now drop lowest and/or highest dice. Thanks Tom for flushing it out!

4D6L1 => roll 4d6 and drop the 1 lowest die
9D6L3H3 => roll 9d6 and drop the 3 lowest and 3 highest dice

- Maps are finally starting to work. Check out tables/elassign.ts to see what you can do with them.
- Added the keys() built-in function. It returns a list of keys in the passed map.
- Touched up the unary operations (+/-/!).

Alpha 3
- Table entries re-vamped. This is what is allowed:

table demo {
1: // empty result
2: ("This is an expression.")
3: ("This is a pre-block expression.") {print("This is the block.");}
4: {print("This is the block.");} ("This is a post-block expression.")
5: {print("This is the block.");}
}

The previous version allowed an arbitrary list of expressions or blocks, but that made the table result kind of complicated.
- Built-in functions:

print(string); => prints the string
range(integer); => returns a list from 0 to integer - 1
len(list); => returns the number of elements in list
append(list,value); => appends value to the end of list
system(string); => launches the system command string
int(value); => cast to integer (not implemented?)
float(value); => cast to float (not implemented?)
str(value); => cast to string

- ARGV is a global list of command line arguments.
- ROLL is the actual roll value available in table scope.

Alpha 2
- ???

Alpha 1
- ???

To Do (In no particular order)

1. Make the memory management actually work. :)
2. Add an optional block of statements that run first when you roll on a table.

table example {

{ print("This runs before the roll is made."); }

1: { print("This is roll 1."); }
2-20: { print("This is roll 2-20."); }
}
3. Implement the "in" operator, as in:

i = 6;
if(i in [1,2,3,4,5,6]) {
print("This prints.");
} else {
print("This doesn't.");
}
4. Sort out how we're going to do user modules.
5. String formatting a la:

"this work's like %sin printf" % ["frick"]

6. Somehow work it out so that we can mark a table as unique, making it impossible to roll the same entry twice.
7. Add line number tracking so that error messages can have some context.
8. Add a stack dump, again for context in error messages.

Enjoy!

J

Posted by Jamie Hale 2003-05-09

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.