Skip to content

Instantly share code, notes, and snippets.

View dstoza's full-sized avatar

Dan Stoza dstoza

View GitHub Profile
#!/usr/bin/env python3
def get_init(factor):
values = []
for i in range(1, 10):
s = str(i)
s = str((i * factor) % 10) + s
while s[0] == '0':
s = str((int(s) * factor) // 10) + s
values += [s]
fn main() {
let ints: Vec<u8> = b"1234"
.into_iter()
.map(|c| c - 48)
.collect();
let length = ints.len();
let mut sum = 0;
for i in 0..length {
/*
if ints[i] == ints[(i + 1) % length] {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class SlowMethod
>>> class Num():
... def __init__(self, value):
... self.value = value
... def get(self):
... return self.value
... def __add__(self, other):
... return Num(self.value + other.value)
...
>>> a = Num(3)
>>> b = a + Num(5)
class Creature:
def __init__(self, name, hp):
self.name = name
self.hp = hp
class Monster(Creature):
def __init__(self, name, hp, intelligence=10):
Creature.__init__(self, name, hp)
self.intelligence = intelligence
class Creature:
def __init__(self, name, hp):
self.name = name
self.hp = hp
class Monster(Creature):
def __init__(self, name, hp, attrs):
Creature.__init__(self, name, hp)
self.int = 10
if 'int' in attrs: