Skip to content

Commit

Permalink
Add skeleton files for exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
pheanex committed Feb 16, 2017
1 parent 76411f4 commit c593556
Show file tree
Hide file tree
Showing 78 changed files with 353 additions and 39 deletions.
2 changes: 2 additions & 0 deletions exercises/accumulate/accumulate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def accumulate(seq, op):
pass
2 changes: 2 additions & 0 deletions exercises/acronym/acronym.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def abbreviate(words):
pass
6 changes: 6 additions & 0 deletions exercises/allergies/allergies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Allergies:
def __init__(self, score):
pass

def is_allergic_to(self, allergy):
pass
2 changes: 2 additions & 0 deletions exercises/anagram/anagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def detect_anagrams(word, candidates):
pass
6 changes: 6 additions & 0 deletions exercises/atbash-cipher/atbash_cipher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def encode(plain):
pass


def decode(ciphered):
pass
6 changes: 6 additions & 0 deletions exercises/beer-song/beer_song.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def verse(count):
pass


def song(first, last):
pass
2 changes: 2 additions & 0 deletions exercises/binary-search/binary_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def binary_search(search_list, value):
pass
2 changes: 2 additions & 0 deletions exercises/binary/binary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def parse_binary(digits):
pass
10 changes: 2 additions & 8 deletions exercises/bob/bob.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
#
# Skeleton file for the Python "Bob" exercise.
#


def hey(what):

return
def hey(stimulus):
pass
2 changes: 2 additions & 0 deletions exercises/bracket-push/bracket_push.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def check_brackets(string):
pass
23 changes: 23 additions & 0 deletions exercises/circular-buffer/circular_buffer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class BufferFullException(Exception):
pass


class BufferEmptyException(Exception):
pass


class CircularBuffer:
def __init__(self, capacity):
pass

def read(self):
pass

def write(self, element):
pass

def overwrite(self, element):
pass

def clear(self):
pass
12 changes: 12 additions & 0 deletions exercises/clock/clock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Clock:
def __init__(self, hour, minute):
pass

def __repr__(self):
pass

def __eq__(self, other):
pass

def add(self, minutes):
pass
2 changes: 2 additions & 0 deletions exercises/crypto-square/crypto_square.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def encode(msg):
pass
2 changes: 2 additions & 0 deletions exercises/diamond/diamond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def make_diamond(letter):
pass
10 changes: 10 additions & 0 deletions exercises/difference-of-squares/difference_of_squares.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def square_of_sum(n):
pass


def sum_of_squares(n):
pass


def difference(n):
pass
2 changes: 2 additions & 0 deletions exercises/etl/etl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def transform(old):
pass
2 changes: 2 additions & 0 deletions exercises/flatten-array/flatten_array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def flatten(iterable):
pass
2 changes: 2 additions & 0 deletions exercises/gigasecond/gigasecond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def add_gigasecond(date):
pass
12 changes: 12 additions & 0 deletions exercises/grade-school/grade_school.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class School:
def __init__(self, name):
pass

def add(self, student, grade):
pass

def grade(self, level):
pass

def sort(self):
pass
6 changes: 6 additions & 0 deletions exercises/grains/grains.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def on_square(number):
pass


def total_after(square):
pass
2 changes: 2 additions & 0 deletions exercises/hamming/hamming.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def distance(s1, s2):
pass
9 changes: 2 additions & 7 deletions exercises/hello-world/hello_world.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
#
# Skeleton file for the Python "Hello World" exercise.
#


def hello(name=''):
return
def hello(name):
pass
2 changes: 2 additions & 0 deletions exercises/hexadecimal/hexadecimal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hexa(s):
pass
6 changes: 6 additions & 0 deletions exercises/house/house.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def verse(n):
pass


def rhyme():
pass
6 changes: 6 additions & 0 deletions exercises/kindergarten-garden/kindergarten_garden.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Garden:
def __init__(self, diagram, students):
pass

def plants(self, student):
pass
2 changes: 2 additions & 0 deletions exercises/largest-series-product/largest_series_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def largest_product(series, length):
pass
2 changes: 2 additions & 0 deletions exercises/leap/leap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def is_leap_year(year):
pass
15 changes: 5 additions & 10 deletions exercises/linked-list/linked_list.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Skeleton file for the Python "linked-list" exercise.
class Node:
def __init__(self, value, next, prev):
pass


class Node(object):
def __init__(self, value, next=None, prev=None):
self.value = value
self.next = next
self.prev = prev


class LinkedList(object):
class LinkedList:
def __init__(self):
pass # Complete the Deque class ...
pass
22 changes: 9 additions & 13 deletions exercises/list-ops/list_ops.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
# Please, do not use the built-in python functions like map, reduce, len, etc.
# that solve the same problems and try to solve it yourself instead.


def map_clone(function, xs):
return xs
pass


def length(xs):
return xs
pass


def filter_clone(function, xs):
return xs
pass


def reverse(xs):
return xs
pass


def append(xs, y):
return xs
pass


def foldl(function, xs, acc):
return xs
pass


def foldr(function, xs, acc):
return xs
pass


def flat(xs):
return xs
pass


def concat(xs, ys):
return xs
pass
16 changes: 16 additions & 0 deletions exercises/luhn/luhn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Luhn:
def __init__(self, number):
pass

def addends(self):
pass

def checksum(self):
pass

def is_valid(self):
pass

@staticmethod
def create(n):
pass
3 changes: 3 additions & 0 deletions exercises/matrix/matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Matrix:
def __init__(self, s):
pass
2 changes: 2 additions & 0 deletions exercises/meetup/meetup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def meetup_day(year, month, day_of_the_week, which):
pass
2 changes: 2 additions & 0 deletions exercises/minesweeper/minesweeper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def board(inp):
pass
2 changes: 2 additions & 0 deletions exercises/nth-prime/nth_prime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def nth_prime(n):
pass
6 changes: 6 additions & 0 deletions exercises/nucleotide-count/nucleotide_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def count(strand, abbreviation):
pass


def nucleotide_counts(strand):
pass
6 changes: 6 additions & 0 deletions exercises/ocr-numbers/ocr_numbers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def number(ocr):
pass


def grid(digits):
pass
File renamed without changes.
2 changes: 2 additions & 0 deletions exercises/octal/octal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def parse_octal(digits):
pass
6 changes: 6 additions & 0 deletions exercises/palindrome-products/palindrome_products.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def largest_palindrome(max_factor, min_factor=0):
pass


def smallest_palindrome(max_factor, min_factor):
pass
2 changes: 2 additions & 0 deletions exercises/pangram/pangram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def is_pangram(sentence):
pass
10 changes: 10 additions & 0 deletions exercises/pascals-triangle/pascals_triangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def triangle(nth):
pass


def is_triangle(t):
pass


def row(nth):
pass
6 changes: 6 additions & 0 deletions exercises/perfect-numbers/perfect_numbers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def divisor_generator(n):
pass


def is_perfect(n):
pass
9 changes: 9 additions & 0 deletions exercises/phone-number/phone_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Phone:
def __init__(self, number):
pass

def area_code(self):
pass

def pretty(self):
pass
2 changes: 2 additions & 0 deletions exercises/pig-latin/pig_latin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def translate(text):
pass
2 changes: 2 additions & 0 deletions exercises/point-mutations/point_mutations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hamming_distance(strand1, strand2):
pass
2 changes: 2 additions & 0 deletions exercises/poker/poker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def poker(hands):
pass
2 changes: 2 additions & 0 deletions exercises/prime-factors/prime_factors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def prime_factors(number):
pass
2 changes: 2 additions & 0 deletions exercises/proverb/proverb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def proverb(itens, qualifier):
pass
10 changes: 10 additions & 0 deletions exercises/pythagorean-triplet/pythagorean_triplet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def primitive_triplets(nbr):
pass


def triplets_in_range(m, n):
pass


def is_triplet(t):
pass
6 changes: 6 additions & 0 deletions exercises/queen-attack/queen_attack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def board(pos1, pos2):
pass


def can_attack(pos1, pos2):
pass
10 changes: 10 additions & 0 deletions exercises/rail-fence-cipher/rail_fence_cipher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def fence_pattern(rails, size):
pass


def encode(msg, rails):
pass


def decode(msg, rails):
pass
2 changes: 2 additions & 0 deletions exercises/raindrops/raindrops.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def raindrops(number):
pass
2 changes: 2 additions & 0 deletions exercises/rectangles/rectangles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def count(lines):
pass
File renamed without changes.
2 changes: 2 additions & 0 deletions exercises/rna-transcription/rna_transcription.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def to_rna(dna_strand):
pass
3 changes: 3 additions & 0 deletions exercises/robot-name/robot_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Robot:
def __init__(self):
pass
15 changes: 15 additions & 0 deletions exercises/robot-simulator/robot_simulator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Robot:
def __init__(self, bearing, x, y):
pass

def advance(self):
pass

def turn_left(self):
pass

def turn_right(self):
pass

def simulate(self, commands):
pass
2 changes: 2 additions & 0 deletions exercises/roman-numerals/roman_numerals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def numeral(number):
pass
Loading

0 comments on commit c593556

Please sign in to comment.