Skip to content

Instantly share code, notes, and snippets.

#ifndef NUM_THROWS
#define NUM_THROWS 100
#endif
#include <iostream>
#include <iomanip>
#include <cstdint>
template <unsigned K>
struct bigint
@avorobey
avorobey / BALLS.BAS
Created February 3, 2024 22:34
GW-BASIC program that displays two balls bouncing around on a tiled field "eating into" each other's spaces.
80 SCREEN 9:VIEW
90 DEFINT A-Z
95 X0=200:Y0=30
100 LINE (X0,Y0)-(X0+299,Y0+299),3,BF
120 LINE (X0+150,Y0)-(X0+299,Y0+299),1,BF
150 DIM A%(200):DIM B%(200)
155 LINE (543,23)-(557,37),3,BF:LINE(563,23)-(577,37),1,BF
160 CIRCLE (550,30),7,1,0,2*3.14,1:CIRCLE (570,30),7,3,0,2*3.14,1
170 PAINT (550,30),1:PAINT(570,30),3
180 GET (543,23)-(557,37),A%:GET (563,23)-(577,37),B%
@avorobey
avorobey / ed.c
Last active October 16, 2018 21:22
V7 Unix ed.c modified to build on modern systems
/* Adapted from https://github.com/v7unix/v7unix/blob/master/v7/usr/src/cmd/ed.c with slight fixes. */
/*
* Editor
*/
#include <signal.h>
#include <sgtty.h>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>