Skip to content

Instantly share code, notes, and snippets.

View Woozl's full-sized avatar

David Glymph Woozl

View GitHub Profile
// Dynamic Programming Examples
// From FreeCodeCamp
// https://www.youtube.com/watch?v=oBt53YbR9Kk
// =========================== FIBONACCI ===========================
// Return the number of the fibonacci sequence at n.
@Woozl
Woozl / fibonacci.ts
Created June 27, 2022 01:58
Generates the Fibonacci sequence using Iterable function
function* fib(n: number) {
if(n <= 1) {
yield 0;
}
else {
let twoBefore = 0, oneBefore = 1;
yield twoBefore;
yield oneBefore;
for(let i = 2; i < n; ++i) {
const current = twoBefore + oneBefore;
@Woozl
Woozl / download-minecraft-skin.ts
Last active June 22, 2022 20:47
Downloads a Minecraft skin using Mojang's player API
// https://davidglymph.com/blog/https-api-fetch-with-promises/
// To run script, make sure you have ts-node installed "npm i -g ts-node",
// replace {USERNAME} with a valid Minecraft account
//
// ts-node download-minecraft-skin.ts {USERNAME}
import https from 'https';
import http from 'http';
import fs from 'fs';
@Woozl
Woozl / main.cpp
Created December 2, 2016 20:35
Section_02 > BullCowGame
#include <iostream>
#include <string>
#include "FBullCowGame.h"
void PrintIntro();
void PlayGame();
bool AskToPlayAgain();
std::string GetGuess();
FBullCowGame BCGame;