Skip to content

Instantly share code, notes, and snippets.

#include <stdlib.h>
#include <stdio.h>
typedef struct Node {
struct Node *next;
int val;
} Node;
Node* constructTestLL() {
Node *root;
import Control.Monad
import Data.Char
-- Memory | Code | Program Input
data P = P [Int] [Char] [Char]
main = do
fstLine <- getLine
secLine <- getLine
rawCodeFile <- replicateM (read $ last $ words fstLine) getLine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
using System.Threading;
namespace Lab2
{
#include <iostream>
#include <vector>
#include <map>
#include <math.h>
using namespace std;
// map of <last top point ix, last bottom point ix> to path length
map< pair< int, int>, double > d_map;
int len;
1 balls up to throw height 5
|---------|
|0|0|0|0|1|
|0|0|0|1|0|
|0|0|1|0|0|
|0|1|0|0|0|
|1|0|0|0|0|
|-|-|-|-|-|
|^| | | | |
|1<0| | | |
// alt ans:
#include <vector>
int main() {
vector< pair<int, string> > ir_map;
ir_map.push_back( make_pair(1000, "M") );
ir_map.push_back( make_pair(900, "CM") );
ir_map.push_back( make_pair(500, "D") );
ir_map.push_back( make_pair(400, "CD") );
// Program to convert to roman numerals.
//
// I'm going to split the number into digits, and call a function to
// convert each one to roman numerals individually.
#include <string>
#include <iostream>
using namespace std;
$(document).keydown(function(e) {
switch(e.which) {
case 'h': // left
createjs.Sound.play((wordNumber = (wordNumber %5) + 1) + "_1", createjs.Sound.INTERRUPT_NONE, 0, 0, false, 1);
break;
case 'j': // up
createjs.Sound.play((wordNumber = (wordNumber %5) + 1) + "_2", createjs.Sound.INTERRUPT_NONE, 0, 0, false, 1);
break;
// As simple of a starting point as I can make for a console game!
// Aka a very stripped down version of my own project.
// Reads console input as arrow keys and wasd,
// and allows you to move a player around the screen.
// To build, save as starting_point.cpp, then build with
// g++ starting_point.cpp -o starting_point -lncurses
#include <iostream>
#include <clocale>
#include <cmath>
#include <ncurses.h>
#include <unistd.h>
#include <vector>
#include <ctime>
#include <cstdlib>
using namespace std;