scwizard
|
codepad
|
|
scwizard
|
Saved pastes by scwizard:
#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) |
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) |
#include <iostream>
#include <list>
// Disclaimer. I read the Sieve of Eratosthenes wikipedia article.
|
view (67 lines, 1 line of output) |
class Maladroitness(Spells):
gestures = ["DSF"]
priority = 20
flavor = target.name + " starts to lose coordination."
def effects(Warlocks):
|
view (18 lines) |
What openings 100% won't die to FP on turn eight?
Lets say you open like this:
FFFFFFFF
PWPFSSSD
|
view (28 lines) |
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) |
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) |
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) |
def curry(func, *args):
try:
return func(*args)
except TypeError:
def recur(*missing_args):
|
view (12 lines, 1 line of output) |
path(X) :- path(X, []).
path([], _).
path([_], _).
path([A, B | T], VISTED) :-
passage(A, B),
|
view (43 lines) |
def DeltaY(input):
input = input - 1
if down - (-1 * input) >= up - input:
return -2 * (up - input)
else:
|
view (21 lines, 22 lines of output) |
def DeltaY(input):
input = input - 1
if down - (-1 * input) > up - input:
return -2 * (up - input)
else:
|
view (20 lines, 2 lines of output) |
int main() {
unsigned int u = 0xFFFFFFFF;
printf("%u\n", u);
u = u + 1;
printf("%u\n", u);
|
view (7 lines, 2 lines of output) |
# 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) |
# 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) |
"LinkedList" is a type{@of sequence{},
@member{private,
@named "beginning",
@type ListNode{}
},
|
view (62 lines) |
// "Left" rotation.
if(x->right != nullptr) {
x->right->prev->left = x->right;
x->right->prev->left->parent = x->right->prev;
|
view (33 lines) |
// Preorder "rotations" :O
// The results: http://img6.imageshack.us/img6/4388/oddrotations.png
// "Up" rotation.
if(x->prev != x->parent) {
|
view (35 lines) |
if[x < '0' | then function{
std::out["If"];
},
else if[x > '0' | then function {
std::out["else if"];
|
view (10 lines) |