This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dynamic Programming Examples | |
// From FreeCodeCamp | |
// https://www.youtube.com/watch?v=oBt53YbR9Kk | |
// =========================== FIBONACCI =========================== | |
// Return the number of the fibonacci sequence at n. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include "FBullCowGame.h" | |
void PrintIntro(); | |
void PlayGame(); | |
bool AskToPlayAgain(); | |
std::string GetGuess(); | |
FBullCowGame BCGame; |