This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import struct | |
resfile = file(sys.argv[1]).read() | |
(dataoffset, mapoffset, datalen, maplen) = struct.unpack(">4I", resfile[:16]) | |
print "Data: %d bytes at %d" % (datalen, dataoffset) | |
print "Map: %d bytes at %d" % (maplen, mapoffset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# mlx.py - convert a .PRG program into an MLX listing. | |
# By default it uses the MLX 1 format (7 decimals per line), but | |
# the -2 option will use the MLX 2 format (9 hexadecimals per line). | |
import sys | |
def mlx1_encode(code, start_address): | |
while len(code) % 6 != 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns king.model) | |
(defn year-prices | |
"Returns an update structure with new prices for land and farming." | |
[] | |
{:landvalue (+ 95 (rand-int 11)) | |
:plantcost (+ 10 (rand-int 6))}) | |
(defn initial-stats | |
"Produces an initial state, which is the Year 1 initial position." |