PrequelPlay
play with code
pqp.ticks_per_secondConstant (30).pqp.elapsed_ticksNumber of ticks elapsed executing the program.Resets every 27000 ticks (15 minutes).Updates only after each call to pqp.update.pqp.paletteCurrent palette.Defaults to the CGA palette.Can be changed with pqp.set_palette.pqp.cameraConstant (0).pqp.noneConstant (1).pqp.max_vertex_countConstant (9600).pqp.max_sound_countConstant (32).pqp.max_sound_priorityConstant (32).pqp.max_sound_channelsConstant (4).pqp.max_main_instrs_tickConstant (10232).pqp.max_main_memory_kbConstant (16384).pqp.max_bot_countConstant (4).pqp.max_bots_instrs_tickConstant (2568).pqp.max_bot_memory_kbConstant (1024).pqp.status_idlepqp.status_runpqp.status_returnpqp.status_haltpqp.status_errorpqp.status_cancelConstants (0, 1, 2, 3, 4, 5).pqp.state_unknownpqp.state_waitpqp.state_unchangedpqp.state_notsetpqp.state_okConstants (0, 1, 2, 3, 4).
pqp.update()Update the display.Restart program counter.Note: Many other functions take effectonly after calling this one.pqp.set_title(title)Takes effect after pqp.update(throttled down to once per second).pqp.set_palette(palette)Takes effect after pqp.update.obj = pqp.create(points)pqp.remove(obj)pqp.set_color(obj, coloridx)Takes effect after pqp.update.pqp.set_visible(obj, bool)Takes effect after pqp.update.pqp.set_origin(obj, x, y)Takes effect after pqp.update.pqp.set_angle(obj, angle)Takes effect after pqp.update.pqp.set_scale(obj, scale)Takes effect after pqp.update.pqp.set_touchable(obj, bool)pqp.move_to_front(obj, other_obj)Takes effect after pqp.update.pqp.move_to_back(obj, other_obj)Takes effect after pqp.update.?sx, ?sy = pqp.read_pressed()?sx, ?sy = pqp.read_released()If event pressed/released, thensx and sy are the valuesof the screen coordinates.Otherwise,sx and sy are undefinedx, y = pqp.screen_to_world(sx, sy)obj = pqp.get_touchable(x, y, prev_obj)bool = pqp.is_contained(x, y, obj)bool = pqp.are_overlapping(obj, other_obj)pqp.sound(soundidx, ?priority=1)y, i, q = pqp.rgb_to_yiq(r, g, b)r, g, b = pqp.yiq_to_rgb(y, i, q)h, l, s = pqp.rgb_to_hls(r, g, b)r, g, b = pqp.hls_to_rgb(h, l, s)h, s, v = pqp.rgb_to_hsv(r, g, b)r, g, b = pqp.hsv_to_rgb(h, s, v)pqp.reset(max_parallel_bots)bool = pqp.is_loaded(botidx)bool = pqp.is_accepting(botidx)pqp.accept(botidx)Takes effect after pqp.update.pqp.refuse(botidx)Takes effect after pqp.update.pqp.unload(botidx)Takes effect after pqp.update.bool = pqp.launch(botidx, data)Takes effect after pqp.update.Note: If data > 1048576 chars,it defaults to the empty list.pqp.cancel(botidx)status = pqp.get_status(botidx)result = pqp.read_result(botidx)y, mo, d, h, mi, s, w = pqp.get_date()Get date (UTC), wherey = year : 0 -> 2000, 1 -> 2001, ...mo = month : 0 -> Jan, ..., 11 -> Decd = day : 0 -> 1, ..., 30 -> 31h = hours : 0, ..., 23mi = minutes: 0, ..., 59s = seconds: 0, ..., 59w = weekday: 0 -> Sun, ..., 6 -> Satpqp.srandom(seed)pqp.set_state(state)Takes effect after pqp.update(throttled down to about once per minute).status, ?state = pqp.read_state()Note: status = pqp.state_unknown ifproject cannot be found on server.Try to (re-)upload it.Note: New states are throttled downto about once per minute
pqp.dataNumber or listfrom which the bot result must be calculatedand returned through function pqp.return.
pqp.return(result)End computation andpass the result (number or list)to the main program (pqp.read_result).