Skip to content

Instantly share code, notes, and snippets.

View Ratstail91's full-sized avatar
💭
Back in my day, we didn't need no AI.

Kayne Ruse Ratstail91

💭
Back in my day, we didn't need no AI.
View GitHub Profile
@Ratstail91
Ratstail91 / stockmarket.js
Created October 24, 2019 06:09
An example API for interacting with a stock market trading game.
//the tickers of different businesses
const APPL = 'APPL'; //Applied Phlebotinum League
const MSFT = 'MSFT'; //Mattress Surfer's Team Assiciation
const LNUX = 'LNUX'; //Let's Not Use Experts
const OK = 0;
const ERR_NOT_ENOUGH_MONEY = -1;
const ERR_NOT_ENOUGH_STOCK = -2;
const FIRE_CEO = 1;

Outline

This is a game where a randomized story is told by a deck of cards. The front face of a card has a short snippet of text followed by an A/B choice, while the back face of the card reveals the results of that choice. Some results might include shuffling new cards into the deck, gaining an achievement or gaining or losing a point of reputation, which will impact the effect of other cards when they are drawn.

Urchins I

There are mysterious ruins just outside the Capitol, where kids sometimes go to play, despite their parents forbidding them. One of your duties is to ensure that nobody ventures inside, for their own safety. During one of your rounds, you see a doorway that you hadn’t previously noticed. What do you do? Take a peek. Leave it alone.

A. Down a long corridor, you find yourself in an old temple of some sort. On the altar is a small but beautifully crafted bracelet. You decide to take it for yourself, as nobody would miss it.

Urchins I

There are mysterious ruins just outside the Capitol, where kids sometimes go to play, despite their parents forbidding them. One of your duties is to ensure that nobody ventures inside, for their own safety. During one of your rounds, you stumble across a small temple of some sort. On the altar is a small but beautifully crafted bracelet. What do you do?

A. Take it.
B. Leave it alone.

A. After a quick look around the temple, you decide to take the bracelet for yourself. Nobody will miss it.

Shuffle card X [Urchins II] into the deck.

/*
images could be saved in the format:
character-clothing-expression
this would allow setImage() to be split into different functions like:
setClothing()
setExpression()
@Ratstail91
Ratstail91 / pseudocode.md
Created April 15, 2020 11:45
The officially official definition of pseudocode.

Pseudocode

Single-line comments begin with // and end at the end of the line.

To output something to the screen, you can use the keyword output, followed by the value to be outputted.

variables are defined using the var keyword - there are no constants.

All standard libraries are assumed to have already been invoked, however if you need to explicitly signal that a library is needed, you can do it thusly:

using System;
//using UnityEngine;
public static class TimeManager {
//constants for reuse below
public const int FULL_DAY_LENGTH = 1440;
public const int HORDE_NIGHT_FREQUENCY = 7;
//these can be controlled by an external calendar script
public static int sunrise = 240;
using System;
public static class Calendar {
public enum Month {
JANUARY = 1, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER
}
public enum EventType {
NONE,
CHRISTMAS,
@Ratstail91
Ratstail91 / example.jsx
Created May 6, 2020 09:09
I didn't run this, but it should be mostly correct.
import React from 'react';
import ReactDOM from 'react-dom';
class ExampleClass extends React.Component {
constructor(props) {
super(props);
this.state = {
isClicked: false;
};
}
@Ratstail91
Ratstail91 / Untitled Card Game.md
Last active May 27, 2020 22:32
Rules for a legacy card game in progress.
//10x programmers (this shitpost took a fucking hour, wtf):
const rl = require('readline').createInterface({
input: process.stdin, output: process.stdout
});
let table = {};
const q = (prompt, key) => () => new Promise(res => rl.question(prompt, answer => res(Object.assign(table, { [key]: answer })) ));
Promise.resolve()
.then(q('what is your name?', 'name'))