[ create a new paste ] login | about

scwizard

Name: scwizard
Email:
Site/Blog:
Location: New York
Default language: Plain Text
Favorite languages: C++1x
About: Computer Science student at Stony Brook University

Saved pastes by scwizard:

C++, pasted on Feb 13:
1
2
3
4
5
#include <iostream>

bool is_palindrome(unsigned int x) {
 unsigned int dig_6 = x % 1000000 / 100000;
 unsigned int dig_5 = x % 100000 / 10000;
...
view (46 lines, 1 line of output)
C++, pasted on Feb 13:
1
2
3
4
5
#include <iostream>

bool check_result(unsigned int x) {
 if(x % 20 == 0
 && x % 19 == 0
...
view (33 lines, 1 line of output)
C++, pasted on Feb 13:
1
2
3
4
int main() {
 unsigned int square_of_sum = 0;
 unsigned int sum_of_square = 0;
 unsigned int n = 1;
...
view (19 lines, 1 line of output)
C++, pasted on Feb 13:
1
2
3
4
#include <iostream>
#include <list>

// Disclaimer. I read the Sieve of Eratosthenes wikipedia article.
...
view (67 lines, 1 line of output)
Python, pasted on Mar 19:
1
2
3
4
5
class Maladroitness(Spells):
	gestures = ["DSF"]
	priority = 20
	flavor = target.name + " starts to lose coordination."
	def effects(Warlocks):
...
view (18 lines)
Plain Text, pasted on Mar 19:
1
2
3
4
5
What openings 100% won't die to FP on turn eight?

Lets say you open like this:
FFFFFFFF
PWPFSSSD
...
view (28 lines)
C++, pasted on Feb 14:
1
2
3
4
5
#include "stdafx.h"

using std::wcout;
using std::endl;
using std::wstring;
...
view (28 lines)
Plain Text, pasted on Jan 9:
1
2
3
4
5
Land:
2 Eiganjo Castle
4 Hallowed Fountain
4 Karakas
4 Flooded Strand
...
view (24 lines)
C++, pasted on Dec 27:
1
2
3
4
5
#include <iostream>
#include <string>
#include <vector>

using std::cout;
...
view (78 lines, 4 lines of output)
C++, pasted on Dec 19:
1
2
3
4
5
/**
 * \file goodpractice.cpp
 * \author Paul Dejean
 * \date 12-18-09
 * 
...
view (173 lines, 13 lines of output)
C++, pasted on Dec 19:
1
2
3
4
5
/**
 * \file goodpractice.cpp
 * \author Paul Dejean
 * \date 12-18-09
 * 
...
view (170 lines, 13 lines of output)
C++, pasted on Dec 19:
1
2
3
4
5
/**
 * \file goodpractice.cpp
 * \author Paul Dejean
 * \date 12-18-09
 * 
...
view (153 lines, 6 lines of output)
Python, pasted on Dec 17:
1
2
3
4
5
def curry(func, *args, **keywords):
	def recur(*missing_args, **missing_keywords):
		if missing_args or missing_keywords:
			new_keywords = keywords.copy()
			new_keywords.update(missing_keywords)
...
view (15 lines, 1 line of output)
Python, pasted on Dec 17:
1
2
3
4
5
def curry(func, *args, **keywords):
	def recur(*missing_args, **missing_keywords):
		if (not missing_args) and (not missing_keywords):
			return func(*args, **keywords)
		else:
...
view (15 lines, 1 line of output)
Python, pasted on Dec 17:
1
2
3
4
5
def curry(func, *args, **keywords):
	try:
		return func(*args, **keywords)
	except TypeError:
		def recur(*missing_args, **missing_keywords):
...
view (14 lines, 1 line of output)
Python, pasted on Dec 17:
1
2
3
4
5
def curry(func, *args):
	try:
		return func(*args)
	except TypeError:
		def recur(*missing_args):
...
view (12 lines, 1 line of output)
Plain Text, pasted on Dec 13:
1
2
3
4
5
path(X) :- path(X, []).
path([], _).
path([_], _).
path([A, B | T], VISTED) :-
	passage(A, B),
...
view (43 lines)
C++, pasted on Dec 9:
1
2
3
4
5
#include <iostream>
#include <string>

using std::cout;
using std::endl;
...
view (83 lines, 6 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (75 lines, 6 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (75 lines, 24 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (65 lines, 8 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (64 lines, 8 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (63 lines, 8 lines of output)
C++, pasted on Dec 7:
1
2
3
4
/*Tokenizing Square*/

#include<iostream>
using namespace std;
...
view (118 lines, 10 lines of output)
C++, pasted on Dec 7:
1
2
3
4
5
#include <iostream>
#include <string>

class Rectangle {
private:
...
view (63 lines, 8 lines of output)
Python, pasted on Nov 18:
1
2
3
4
5
def DeltaY(input):
	input = input - 1
	if down - (-1 * input) >= up - input:
		return  -2 * (up - input)
	else:
...
view (21 lines, 22 lines of output)
Python, pasted on Nov 18:
1
2
3
4
5
def DeltaY(input):
	input = input - 1
	if down - (-1 * input) > up - input:
		return  -2 * (up - input)
	else:
...
view (20 lines, 2 lines of output)
C, pasted on Nov 16:
1
2
3
4
5
int main() {
signed int a = 5;
signed int b = -3;

printf("%d\n", a - b);
...
view (9 lines, 2 lines of output)
C, pasted on Nov 16:
1
2
3
4
5
int main() {
unsigned int u = 0xFFFFFFFF;
printf("%u\n", u);
u = u + 1;
printf("%u\n", u);
...
view (7 lines, 2 lines of output)
Python, pasted on Nov 16:
1
2
3
4
5
# Calculates the amount of pixels the unit has moved from one tick ago as a signed integer value. Negative is up, positive is down.

from copy import deepcopy

UP = False # Negative.
...
view (74 lines, 1 line of output)
Python, pasted on Nov 15:
1
2
3
4
5
# Calculates the amount of pixels the unit has moved from one tick ago as a signed integer value. Negative is up, positive is down.

from copy import deepcopy

UP = False # Negative.
...
view (70 lines, 1 line of output)
Plain Text, pasted on Oct 7:
1
2
3
4
5
"LinkedList" is a type{@of sequence{},
	@member{private,
		@named "beginning",
		@type ListNode{}
	},
...
view (62 lines)
C++, pasted on Mar 7:
1
2
3
4
// "Left" rotation.
if(x->right != nullptr) {
	x->right->prev->left = x->right;
	x->right->prev->left->parent = x->right->prev;
...
view (33 lines)
C++, pasted on Mar 7:
1
2
3
4
5
// Preorder "rotations" :O
// The results: http://img6.imageshack.us/img6/4388/oddrotations.png

// "Up" rotation.
if(x->prev != x->parent) {
...
view (35 lines)
C++, pasted on Mar 1:
1
2
3
4
5
// Testing of shrub.

#include <iostream>
#include <deque>
#include <list>
...
view (206 lines)
C++, pasted on Mar 1:
1
2
3
4
#define nullptr 0
#define EVER ;;
#define IMPLEMENTS :
#define INITIALIZER_LIST :
...
view (904 lines, 8 lines of output)
Plain Text, pasted on Jan 27:
1
2
3
4
5
if[x < '0' | then function{
	std::out["If"];
},
else if[x > '0' | then function {
	std::out["else if"];
...
view (10 lines)
Plain Text, pasted on Jan 20:
1
2
3
4
5
# My version:
function {
	std$vector{'1.3', '2.7', '3.9'} of double{}:; named "from";:
	variable std$vector{'7', '8', '9'} of int{}:; named "to";:
	std$copy[] from from; range from.begin[]: to from.end[]:; to to.begin[]:;:
...
view (57 lines)