This file contains 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 'minitest/autorun' | |
class Room | |
attr_reader :room_number | |
def initialize(room_number, x, y, side_length) | |
@room_number = room_number | |
@x, @y, @side_length = x, y, side_length | |
end |
This file contains 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
using System; | |
using System.Linq; | |
namespace yhpg | |
{ | |
internal enum Direction | |
{ | |
Up = 0, Down, Left, Right, None | |
} |
This file contains 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 <vector> | |
#include <string> | |
#include <sstream> | |
#include <iostream> | |
#include <algorithm> | |
using matrix_t = std::vector<std::vector<int>>; | |
const std::string commands { "abcdefihglkj" }; |
This file contains 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 <cctype> | |
#include <string> | |
#include <vector> | |
#include <sstream> | |
#include <iterator> | |
#include <iostream> | |
#include <algorithm> | |
const char unoccupied_char = '-'; |
This file contains 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 <string> | |
#include <vector> | |
#include <iomanip> | |
#include <iostream> | |
#include "boost/range/adaptors.hpp" | |
#include "boost/algorithm/string.hpp" | |
const int invalid_pos = -1; | |
const std::string empty_string = "0"; | |
const std::string block_string = "1"; |
This file contains 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 <vector> | |
#include <string> | |
#include <sstream> | |
#include <iostream> | |
#include <iterator> | |
#include <algorithm> | |
const std::vector<int> lines = { | |
128, 64, 32, 16, 8, 4, 2, 1, | |
}; |
This file contains 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 <string> | |
#include <vector> | |
#include <iostream> | |
class HexagonalTetromino | |
{ | |
public: | |
HexagonalTetromino( | |
const std::string & name, | |
const std::string & src, |
This file contains 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 <regex> | |
#include <string> | |
#include <vector> | |
#include <numeric> | |
#include <iostream> | |
#include "boost/algorithm/string.hpp" | |
class Triomino | |
{ | |
public: |
This file contains 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 <vector> | |
#include <string> | |
#include <memory> | |
#include <iostream> | |
#include <algorithm> | |
#include <unordered_map> | |
struct is_tetromino | |
{ | |
bool operator()(char chr) |
This file contains 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
const flatten = (ary) => { | |
return [].concat(...ary); | |
}; | |
const parse = (src) => { | |
return flatten(flatten(src.split('/').map((rect) => { | |
return rect.split('-'); | |
})).map((pt) => { | |
return pt.split(','); | |
})).map((s) => { |
NewerOlder