Skip to content

Instantly share code, notes, and snippets.

View odiepus's full-sized avatar

Hector Herrera odiepus

  • 'Murica
View GitHub Profile
@odiepus
odiepus / GarageClicker.cpp
Last active March 22, 2019 11:50
Garage Door Opener #260 c++
#include "GarageClicker.h"
#include <iostream>
//states are numbered.
//0 = open 1 = closing 2 = closed 3 = opening 4 = stopped while closing 5 = stopped while opening
GarageClicker::GarageClicker(){
state = 2;//set initial state to closed
}
void GarageClicker::inputs(int y)//only 2 inputs click (0) or cycle complete (1)
{
puts "Please enter a year to see if it is a leap year: "
year_input = gets.to_i
def leap_year? (input_year)
by_400 = input_year % 400
by_4 = input_year % 4
by_100 = input_year % 100