This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |