Skip to content

Instantly share code, notes, and snippets.

View mbutler's full-sized avatar
🇦🇶
Exploring

Matthew Butler mbutler

🇦🇶
Exploring
View GitHub Profile
@mbutler
mbutler / startrek.js
Created October 10, 2024 04:40
classic 70s Star Trek BASIC game in JS
// Star Trek Game in JavaScript
// Original BASIC version by Mike Mayfield, converted to JavaScript
"use strict";
// Constants
const GALAXY_SIZE = 8;
const SECTOR_SIZE = 8;
const MAX_DOCK_STARS = 9;
const COMMANDS = ["NAV", "SRS", "LRS", "PHA", "TOR", "SHE", "DAM", "COM", "XXX"];
@mbutler
mbutler / processed_episodes.json
Last active September 16, 2024 22:36
Process Star Trek episode synopses
This file has been truncated, but you can view the full file.
[
{
"title": "Encounter At Farpoint (1)",
"episode_number": "1",
"summary": "Stardate 41153.7 While en route to Farpoint, Captain Picard and his crew encounter a god-like being called Q, who places humanity on trial for barbarism. Captain Picard has to prove to Q that the Human race is not barbaric; otherwise, the entire human race will be destroyed. Meanwhile, on Farpoint, the newly assigned second-incommand, Commander William T. Riker, must solve the mysterious goings on, on the planet, before the Federation makes their decision on if they may join the Federation of planets. Somehow, both Picard and Riker's separate tasks become intertwined. The year is 2364. Captain Jean-Luc Picard takes command of the new starship, the Galaxy-class USS EnterpriseD, the fifth Federation ship to bear the name Enterprise. The ship is about to embark on its first mission to Deneb IV, beyond which lies the great unexplored mass of the galaxy. Picard, in his log, notes that he is impressed with the size and compl
@mbutler
mbutler / magazines.mb
Created September 9, 2024 13:53
online magazines
https://fotta.it/
https://undark.org/

Combat and Actions Overview

All Attack Types Modifiers

Modifier Melee Attacks Ranged Attacks
Combat Advantage against foe +2 +2
Attacker is prone -2 -
Target has normal cover - -2
Target has superior cover - -5

Condition Summary (PHB 277)

Blinded

  • You grant combat advantage.
  • You can’t see any target (your targets have total concealment).
  • You take a –10 penalty to Perception checks.
  • You can’t flank an enemy.

Dazed

  • You grant combat advantage.
@mbutler
mbutler / edgs.md
Created May 26, 2024 23:28
EDGS: The entity-defined game system

The Entity-Driven Game System (EDGS) is a foundational framework designed for the creation, analysis, and discussion of game mechanics across various types of games, including RPGs, board games, card games, and more. It is built upon strict and precise definitions that scaffold into a complex system, akin to formal logic proofs, supported by straightforward equations. The goal of EDGS is to provide a robust toolkit for designing game systems and generating coherent content within those systems, ensuring sound game principles. Each

Entity: Defined as a unique instance within the game universe that possesses distinguishable characteristics enabling identification and interaction.

Attribute, Change, State, Action, Reaction, Capability, Limitation, Environment, Rule, Interaction, Event, Outcome, Probability, Consequence, Objective, Challenge, Resource, Conflict, Resolution, Narrative, Mechanism, Character, Item, System, Process, Structure, Device, Element, Artifact, Organism, Network, Interface, Agent, Phenom

@mbutler
mbutler / phoenix-command.md
Last active May 18, 2024 15:37
Phoenix Command Small Arms Combat System - Leading Edge Games

1.0 Welcome to Phoenix Command

For those unfamiliar with role-playing games or wargames, Phoenix Command is an excellent introduction to the fascinating world of simulation gaming. Just as chess represents a strategic game of conquest and strategy, Phoenix Command details the action in modern small arms combat. Like chess, playing pieces moved on a playing surface resolve the action. But unlike chess, the playing pieces in Phoenix Command represent individual people, or characters, with combat resolved on a second-by-second basis. The outcome depends on each character's actions, skill, and strategy.

Any number of people can play Phoenix Command; it is ideally suited to two teams, with a referee to moderate the action.

1.1 Using the Game

Phoenix Command is a small arms combat system. It has been designed for use as a stand-alone game or as a combat system for any other game. Its self-contained rules may be used to accurately recreate combat scenarios from books, movies, current events, or history. All

https://watabou.itch.io/
https://donjon.bin.sh/
https://hexroll.app/
https://azgaar.github.io/Fantasy-Map-Generator/
@mbutler
mbutler / dicepools.py
Last active February 5, 2024 22:24
working with dice pools
import random
import collections
def roll_dice(dice):
"""Rolls mixed dice and returns the sum.
- dice: List of tuples (die_size, quantity) for each die type."""
total = 0
for die_size, quantity in dice:
for _ in range(quantity):
total += random.randint(1, die_size)
@mbutler
mbutler / fsk.py
Created January 20, 2024 19:36
Simple Frequency Shift Keying implementation for digital modulation
import numpy as np
import wave
import struct
from scipy.signal import butter, lfilter
# Function to convert text to FSK and save as a WAV file
def text_to_fsk_wave(text, filename):
bit_rate = 1200
freq_low = 1200
freq_high = 2400