Skip to content

Instantly share code, notes, and snippets.

@mikemar10
mikemar10 / main.rb
Last active October 25, 2020 04:53
Procedural Hexagons in DragonRuby
class Hexagon
attr_reader :x, :y, :radius, :r, :g, :b, :angle
def initialize args, x, y, radius, r = 0, g = 0, b = 0, angle = 0
@x = x
@y = y
@radius = radius
@r = r
@g = g
@b = b
@angle = angle
@mikemar10
mikemar10 / pong.c7
Last active March 5, 2021 01:44
A very basic pong game written for https://rxi.itch.io/cel7
(= title "Pong")
(= width 32)
(= height 24)
; macros
(= incr (mac (x) (list '= x (list '+ x 1))))
(= decr (mac (x) (list '= x (list '- x 1))))
(= negate (mac (x) (list '= x (list '* x -1))))
(= apply (mac (f args) (list f args)))
(= <<= (mac (a b c) (list 'and (list '<= a b) (list '<= b c))))
#$rom = $dragon.ffi_file.loadfile('roms/space_invaders.ch8').bytes
#$rom = $dragon.ffi_file.loadfile('roms/pong.ch8').bytes
$rom = $dragon.ffi_file.loadfile('roms/breakout.ch8').bytes
#$rom = $dragon.ffi_file.loadfile('roms/maze.ch8').bytes
class Chip8
attr_accessor :game, :inputs, :outputs
def initialize
@ram = Array.new(4096, 0)
@mikemar10
mikemar10 / keybase.md
Created April 7, 2017 23:34
keybase proof

Keybase proof

I hereby claim:

  • I am mikemar10 on github.
  • I am mikemar10 (https://keybase.io/mikemar10) on keybase.
  • I have a public key ASAxswWBaiGf8O9plu77Ijf6tUxqWV9MGFD6CaCj9AfkvAo

To claim this, I am signing this object: