Skip to content

Instantly share code, notes, and snippets.

View peverett's full-sized avatar

Simon Peverett peverett

  • Cambridgeshire, UK
View GitHub Profile
#!/usr/python
"""
A famous casino is suddenly faced with a sharp decline of their revenues. They
decide to offer Texas hold'em also online. Can you help them by writing an
algorithm that can rank poker hands?
Task:
Create a poker hand that has a method to compare itself to another poker hand:
compare_with(self, other_hand)
@peverett
peverett / game-of-life.py
Last active January 4, 2019 11:56
Conway's Game of Life in Python 2.7 using TKinter
#!/usr/bin/python
"""
Conway's Game of Live
Model: Matrix of cells - x, y
View: Tkinter Canvas with grid of cells (rectangles).
Controller: Puts them together.
"""
@peverett
peverett / InterruptBlinky.ino
Created September 29, 2016 20:28
Interrupt Blinky Arduino Sketch for Maple Leaf Mini STM32
/*
* This is an Interrupt Button Test for Maple Leaf Min STM32
*/
#define BOARD_BUTTON_PIN 32
#define BOARD_LED_PIN 33
volatile byte led_state = 0;
void interruptFunction() {
// Maple Lead Mini
// Uses pulldown on input.
// Waits for serial connection.
const int inPin = 22;
int val;
void setup() {
// put your setup code here, to run once:
pinMode(inPin, INPUT_PULLDOWN);