Skip to content

Instantly share code, notes, and snippets.

View KeyFramesOfVi's full-sized avatar

Vi KeyFramesOfVi

View GitHub Profile
@KeyFramesOfVi
KeyFramesOfVi / App.js
Created January 17, 2018 22:08
mario3_concentration implementation in React
import React, { Component } from 'react';
import './game.css';
import Game from './Game';
require('typeface-press-start-2p');
function App(props) {
return (
<Game
@KeyFramesOfVi
KeyFramesOfVi / Parser.cpp
Last active December 7, 2017 03:24
Lisp Parser and Interpreter, takes string of lisp code and runs it.
// Copyright 2017, Victor R. Cabrera
#include "../include/Parser.hpp"
using string_array = std::vector<std::string>;
using list = std::vector<TaggedUnion>;
string_array Parser::split(const std::string & lisp_list) {
/* create a new list that'll hold each string value in a vector. */
string_array split_list;
/* if it's empty, there is nothing to compute. */
if (!lisp_list.empty()) {
@KeyFramesOfVi
KeyFramesOfVi / lfucache.cpp
Last active November 24, 2017 18:13
LFU Cache - Implement put and get functions in O(1) time, removing the least frequently used data when the capacity is full.
#include "lfucache.hpp"
int main() {
LFUCache obj(2);
obj.put(2,2);
cout << obj.get(1) << endl;
obj.put(3,3);
cout << obj.get(2) << endl;
cout << obj.get(3) << endl;
obj.put(4,4);