Skip to content

Instantly share code, notes, and snippets.

#base robot_giant.pop
#base robot_standard.pop
#base robot_gatebot.pop
population
{
StartingCurrency 900
RespawnWaveTime 5
CanBotsAttackWhileInSpawnRoom no
FixedRespawnWaveTime Yes
#base robot_giant.pop
#base robot_standard.pop
population
{
Templates
{
T_TFGateBot_Pyro_Flare_Spammer
{
Class Pyro
#base robot_giant.pop
#base robot_standard.pop
population
{
StartingCurrency 1200
RespawnWaveTime 7
CanBotsAttackWhileInSpawnRoom no
Advanced 1
local modname = ...
local index = package.modtable(modname)
local ffi = require('ffi')
local databuffer = require('databuffer')
local filestorage = require('rsbin.filestorage')
local fileopenmode = require('rsbin.fileopenmode')
local storagestream = require('rsbin.storagestream')
local pngreader = require('rsbin.pngreader')
local pngwriter = require('rsbin.pngwriter')
local bitmapformat = require('rsbin.bitmapformat')
@delfigamer
delfigamer / controller.cpp
Created July 15, 2018 00:30
Control system with object simulation
#include "controller.hpp"
#include "modelfilter.hpp"
namespace controller
{
vector< quantity, 2 > targetpos = { 0.0_m, 0.0_m };
void update()
{
vector< quantity, 2 > posdiff = targetpos - modelfilter::ballpos;
@delfigamer
delfigamer / WINDOWS.H
Created July 28, 2018 19:18
Windows 3.1 SDK
/*****************************************************************************\
* *
* windows.h - Windows functions, types, and definitions *
* *
* Version 3.10 *
* *
* Copyright (c) 1985-1992, Microsoft Corp. All rights reserved. *
* *
*******************************************************************************
*
@delfigamer
delfigamer / STList.hs
Last active July 1, 2020 12:44
A mutable single-linked list in ST monad
module STList (
STList,
STListPtr,
new,
prepend,
append,
mark,
pop,
popUntil,
foldr,
@delfigamer
delfigamer / divisions.cpp
Last active April 27, 2022 06:16
measures the runtime of different variants of the integer division
#include <stdio.h>
#include <stdint.h>
#include <time.h>
template<typename Fn>
void measure(Fn fn) {
clock_t c1 = clock();
fn();
clock_t c2 = clock();
printf("time: %7.3lf\n", (c2 - c1) / (double)CLOCKS_PER_SEC);
@delfigamer
delfigamer / png.lua
Created November 23, 2022 03:32
Simulates artifacts of a certain lossy image compression
local png = {}
local ffi = require('ffi')
local libpng = ffi.load('libpng16.dll')
ffi.cdef[[
typedef struct png_control *png_controlp;
typedef struct
{
require('protectenv')()
local ffi = require('ffi')
local complex = require('complex')
local png = require('png')
local wlen = 4
local wnum = 2*math.pi / wlen
local map = ffi.new('complex_t[512][512]')