#Fibinaries and Pribinaries
Silly script to create numbers in a positional notation using the fibonacci sequence and prime numbers as bases.
rules = [(1,100,1),(101,500,2), (501,1000,3), (1001,1500,4)] | |
tickets = 993.9 | |
entries = round(sum([(b-a+1)/c if (tickets>b) else (tickets-a+1)/c for a,b,c in rules if tickets>a])) | |
print('You have {} entries'.format(entries)) |
class Foo(object): | |
def whoami(self): | |
return [k for k,v in globals().iteritems() if v is self] | |
def whoarewe(self): | |
return [k for k,v in globals().iteritems() if isinstance(v, type(self))] | |
f = Foo() | |
b = Foo() |
join_digits = lambda i, j: int(str(i) + str(j)) | |
def do_the_thing(a, b): | |
for i in range(b): | |
print("{} × {:02d} = {:10d}".format(a, join_digits(i, b-i), a * join_digits(i, b-i))) | |
do_the_thing(12345679, 9) |
import re | |
def is_prime(n): | |
return not re.match(".?$|(..+?)\1+$", "0" * n) |
#Fibinaries and Pribinaries
Silly script to create numbers in a positional notation using the fibonacci sequence and prime numbers as bases.
# coding=utf-8 | |
import matplotlib.pyplot as plt | |
def numToWords(num, join=True): | |
'''words = {} convert an integer number into words''' | |
units = ['','ένα','δύο','τρία','τέσσερα','πέντε','έξι','επτά','οκτώ','εννέα'] | |
teens = ['','έντεκα','δώδεκα','δεκατρία','δεκατέσσερα','δεκαπέντε','δεκαέξι', \ | |
'δεκαεπτά','δεκαοκτώ','δεκαεννέα'] | |
tens = ['','δέκα','είκοσι','τριάντα','σαράντα','πενήντα','εξήντα','εβδομήντα', \ |
I hereby claim:
To claim this, I am signing this object:
1^2 = 1(1+1)/2 = 1 | |
6^2 = 8(8+1)/2 = 36 | |
35^2 = 49(49+1)/2 = 1225 | |
204^2 = 288(288+1)/2 = 41616 | |
1189^2 = 1681(1681+1)/2 = 1413721 | |
6930^2 = 9800(9800+1)/2 = 48024900 | |
40391^2 = 57121(57121+1)/2 = 1631432881 |
#include <stdio.h> | |
#include <stdbool.h> | |
#define MAX_QUEUE_SIZE 15 | |
#define ITEM_LENGTH 32 | |
typedef char queue_element_t [ITEM_LENGTH]; | |
typedef struct circular_queue_t { | |
int front; |
#!/usr/bin/env python | |
""" | |
Find the Adastral Park Hub Menu | |
""" | |
from __future__ import print_function | |
import re | |
import webbrowser |