Skip to content

Instantly share code, notes, and snippets.

Kayne Ruse Ratstail91

View GitHub Profile
@Ratstail91
Ratstail91 / InputLayer.cs
Created Jun 24, 2020
I hope the boss doesn't mind me sharing this file... wait, I am the boss!
View InputLayer.cs
using System;
using UnityEngine;
//DOCS: INPUT_KEYBOARD falls back to the legacy unity input system
//TODO: nintendo switch controls
public static class InputLayer {
//virtual inputs for Candy Raid
public enum Button {
ATTACK, SWITCH, PAUSE
View promise_shitpost.js
//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'))
@Ratstail91
Ratstail91 / Untitled Card Game.md
Last active May 27, 2020
Rules for a legacy card game in progress.
View Untitled Card Game.md
@Ratstail91
Ratstail91 / example.jsx
Created May 6, 2020
I didn't run this, but it should be mostly correct.
View example.jsx
import React from 'react';
import ReactDOM from 'react-dom';
class ExampleClass extends React.Component {
constructor(props) {
super(props);
this.state = {
isClicked: false;
};
}
View Calendar.cs
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,
View TimeManager.cs
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;
@Ratstail91
Ratstail91 / pseudocode.md
Created Apr 15, 2020
The officially official definition of pseudocode.
View pseudocode.md

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:

View shoujo.toy
/*
images could be saved in the format:
character-clothing-expression
this would allow setImage() to be split into different functions like:
setClothing()
setExpression()
View story cards 2.md

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.

View Story Cards.md

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.

You can’t perform that action at this time.