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
| require 'pry' | |
| class Robot | |
| attr_reader :compass | |
| def initialize | |
| @compass = [:north, :east, :south, :west] | |
| @facing_to = true | |
| @x_axis = [] | |
| @y_axis = [] |
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
| class Triplet | |
| attr_reader :alfa, :bravo, :charlie | |
| def initialize(alfa, bravo, charlie) | |
| @alfa = alfa | |
| @bravo = bravo | |
| @charlie = charlie | |
| end | |
| def sum |
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
| class OCR | |
| attr_accessor :text | |
| OCR_DB = { | |
| [' _ ', '| |', '|_|'] => '0', | |
| [' ', ' |', ' |'] => '1', | |
| [' _ ', ' _|', '|_ '] => '2', | |
| [' _ ', ' _|', ' _|'] => '3', | |
| [' ', '|_|', ' |'] => '4', | |
| [' _ ', '|_ ', ' _|'] => '5', |
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
| class SecretHandshake | |
| def initialize(input) | |
| @data = input | |
| @solution = [] | |
| end | |
| def commands | |
| unless @data.to_i == 0 | |
| @data = @data.to_s(2) |
NewerOlder