Skip to content

Instantly share code, notes, and snippets.

View rccarlson's full-sized avatar

Riley Carlson rccarlson

View GitHub Profile
@rccarlson
rccarlson / generate_sd_code.py
Created December 11, 2024 17:07
Generate Covenant Eyes Developer Code
"""
Generates today's code for accessing the Covenant Eyes developer menu.
Developer code is a truncated MD5 hash of the current date, with some formatting applied
"""
import hashlib, datetime
# get current date as ddmmyyyy
today = datetime.datetime.now().strftime(R"%d%m%Y")
@rccarlson
rccarlson / Most Likely of Sum Die Rolls.fs
Last active October 19, 2023 01:59
Implementation of Most Likely of Sum Die Rolls
// A dragon has locked you in a dungeon. In order to escape you must win its game.
// You must pick a number. A D20 dice will be rolled and the values will be added up.
// The total must equal your number or you lose.
// https://www.youtube.com/watch?v=zF814SmPY5A
/// Roll a dice with the given number of sides. Returns the face value (1 indexed)
let rollDice (random: System.Random) sides = random.Next(sides) + 1
/// Runs a game and determines if the game is a win (true) or a loss (false)
let runGame valueGenerator target=