Skip to content

Instantly share code, notes, and snippets.

View Ratstail91's full-sized avatar

Kayne Ruse Ratstail91

View GitHub Profile
@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:

/*
images could be saved in the format:
character-clothing-expression
this would allow setImage() to be split into different functions like:
setClothing()
setExpression()

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.

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.

@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;

Card types:

  • Base Summon Card (1 cost, empty summon, 1 HP by default)

  • Base Weapon Card (1 cost, empty weapon, 1 ATK by default)

  • Base Spell Card (1 cost, empty spell, does nothing)

  • Summon Modifier Card (applies new text to a summon)

  • Weapon Modifier Card (applies new text to a weapon)

  • Spell Modifier Card (apploes new text to a spell)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyController : MonoBehaviour {
//structures
enum Direction {
UP, LEFT, RIGHT, DOWN,
};
//good for preventing duplicated code
[System.Serializable]
struct AudioData {
public string name;
public AudioSource source;
//other data, such as modulation
}
public List<AudioData> audioList = new audioList<AudioData>();
@Ratstail91
Ratstail91 / recursion.toy
Created August 14, 2019 18:46
My interpreter is currently a bit... inconsistent.
/* stack overflow, as expected
var counter = 0;
const recursion = () => {
print ++counter;
recursion();
};
recursion();
*/
@Ratstail91
Ratstail91 / CameraController.cs
Created August 3, 2019 14:39
My attempt at camera shake - didn't work.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour {
[SerializeField]
GameObject target;
[SerializeField]
float lerpSpeed = 2f;