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 <iostream> | |
#include <sstream> | |
#include <vector> | |
std::vector<std::string> split(const std::string &s, char delim) { | |
std::vector<std::string> elems; | |
std::stringstream ss; | |
ss.str(s); | |
std::string item; | |
while (std::getline(ss, item, delim)) { |
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 <iostream> | |
#include <vector> | |
enum Wire {white, black, purple, red, green, orange}; | |
struct State { | |
virtual bool cut(Wire wire) {return true;} | |
}; | |
struct WhiteCutState : State { |