Skip to content

Instantly share code, notes, and snippets.

View ChrisOwen101's full-sized avatar
:octocat:

Christopher Owen ChrisOwen101

:octocat:
View GitHub Profile

Fruit machine

fruit machine

1. Build the Machine

We are going to create a virtual fruit machine. To make things easier instead of symbols we are going to use colours: black, white, green, yellow.

Each time a player plays our fruit machine we display four 'slots' each with a randomly selected colour in each slot.

(base) chrisowen@Chriss-MacBook-Pro-2 docblock % yarn dev
yarn run v1.22.10
warning package.json: License should be a valid SPDX license expression
warning ../../../package.json: No license field
$ yarn --cwd ./nextjs install && docker-compose up
warning ../package.json: License should be a valid SPDX license expression
warning ../../../../package.json: No license field
[1/4] 🔍 Resolving packages...
success Already up-to-date.
[+] Running 3/3
(base) chrisowen@Chriss-MacBook-Pro-2 docblock % yarn dev:reset
yarn run v1.22.10
warning package.json: License should be a valid SPDX license expression
warning ../../../package.json: No license field
$ sh docker-reset.sh && docker-compose up --build --remove-orphans --force-recreate
💣 Resetting DB...
Stopping containers...
9287837959af
63a8bc50f5de
5401186ffec3

Wordle

Create a command line version of the game "Wordle", paying attention to the following stipulations:

  • Code which handles user input must be kept in a separate file to code which handles checking words and awarding wins or losses
  • All functions must be labelled descriptively and comprise of no more than 5 lines of code each
  • All game logic should be stored in a directory named "wordle_game"; outside of this directory, there should be another named "wordle_data"
  • Your Wordle implementation should select each game's target word from a list of valid words within wordle_data named "wordle_words.txt"

The rules of Wordle are as follows:

Data Analysis Assessment Task

Purpose

This task has been designed to assess the following areas:

  • SQL
  • Python
  • Data extraction and manipulation
  • Data visualisation

Meshed Words

You will be given an array of strings. The words in the array should mesh together where one or more letters at the end of one word will have the same letters (in the same order) as the next word in the array. But, there are times when all the words won't mesh.

Examples of meshed words:

  • "apply" and "plywood"
  • "apple" and "each"
  • "behemoth" and "mother"
import { DB } from "https://deno.land/x/sqlite@v2.5.0/mod.ts";
import { Application } from "https://deno.land/x/abc@v1.3.3/mod.ts";
import AsciiTable from "https://deno.land/x/ascii_table/mod.ts";
import { createTable, createData, apiInstructions } from "./data.js";
let db;
// This is a functioning back-end.
// Everything is set up except for the database connections
const app = new Application();
import { Application } from 'https://deno.land/x/abc@v1.3.1/mod.ts'
/*
!!!!!!!
THIS IS BAD CODE. DO NOT CREATE AN API LIKE THIS.
This example should only be used for teaching purposes.
Do not mimic any of techniques found in this example.
@ChrisOwen101
ChrisOwen101 / updatecoursework.md
Last active July 29, 2021 20:57
How to Batch Update All Coursework Repos

This is a really hacky way to update all of the Coursework Repos from the Template repo. It involves:

  1. Cloning every coursework repo
  2. cd into each of them
  3. Add the template repo as a remote
  4. Fetch, pull and marge everything in a slightly unsafe way
  5. push everything
  6. cd out

This methodology follows a single core principle:

@ChrisOwen101
ChrisOwen101 / SigmaSetup.md
Last active July 16, 2021 13:09
Getting Setup at Sigma Labs

Getting Setup at Sigma Labs

If you're reading this page, that means you've been accepted as a student of Sigma Labs. Congratulations! 🎉

We're going to be working together as a team, closely for the next 12 weeks and then over the next two years. To make sure you're as ready as possible to get started please read through this guide and make sure you've completed all of the steps.

1) Background Knowledge

We expect that you join the course with some pre-existing knowledge. It's important that