Skip to content

Instantly share code, notes, and snippets.

How to code for Quest
Josh04
Introduction
-------------------
Quest is built on top of an entirely new PHP framework written by me and Greg, and it can be
confusing at first, especially if you haven't written a program before which follows a design
pattern.
@josh04
josh04 / SCORE
Created May 29, 2013 19:05
Warwick TV Open Source Scoreboard for BBC Basic in RISC OS.
10 MODE 7
11 OFF
13 COV = 0
14 WAR = 0
19 PROCSCREEN(COV, WAR)
20 H$ = GET$
30 IF H$="w" THEN WAR=WAR+1
31 IF H$="e" THEN WAR=WAR-1
40 IF H$="c" THEN COV=COV+1
41 IF H$="v" THEN COV=COV-1
@josh04
josh04 / codegen.py
Created May 20, 2019 19:53
_space_train simple codegen library functions
import json
def get_sheet(filename, sheetname):
with open(filename) as f:
item_database = json.load(f)
item_db_sheets = item_database['sheets']
sheets = [sh for sh in item_db_sheets if sh['name'] == sheetname]
sheet = sheets[0]
sheet_lines = sheet['lines']
@josh04
josh04 / item_codegen.py
Created May 20, 2019 19:54
_space_train simple codegen item functions
import codegen
def item_display_specifiers(o, display_specifiers, default):
first = display_specifiers.pop(0)
o.write(" if (display_specifier == "+str(first['display_specifier'])+") { \n")
o.write(" return {"+str(first['tile']['x'])+", "+str(first['tile']['y'])+"};\n")
o.write(" }")
for pair in display_specifiers:
o.write(" else if (display_specifier == "+str(pair['display_specifier'])+") { \n")
@josh04
josh04 / ros_randomise_i.lua
Created October 30, 2023 09:34
VLC script for playing a video file in a series of defined segments
description="ROS Randomiser"
local common = require("common")
local json = require ("dkjson")
math.randomseed(os.time())
math.random(); math.random(); math.random()
running = true
json_string = [[
@josh04
josh04 / ros_timestamps.py
Created October 30, 2023 09:35
Python script for turning a list of timestamps into the values used by ros_randomise_i.lua (and shuffling them)
import json
import random
json_str = '''["00:00:00.000",
"00:00:08.840",
"00:04:32.840",
"00:06:34.520",
"00:09:22.440",
"00:11:01.960",
"00:12:36.160",