Day 13/solution2.cpp
// For the input to be read correctly there must be no ':' between numbers.
// Returns the last layer
For the input to be read correctly there must be no ':' between numbers.
Returns the last layer
For the input to be read correctly there must be no ' : ' between numbers . Returns the last layer
int ReadFirewall(map<int, int> & firewall, map<int, int> & current_positions, map<int, bool> & going_forward) {
  int pos, last_layer;
  cin >> pos;
  while (cin) {
    cin >> firewall[pos];
    current_positions[pos] = 0;
    going_forward[pos] = true;
    last_layer = pos;
    cin >> pos;
  }
  return last_layer;
}
int ReadFirewall ( map < int , int > & firewall , map < int , int > & current_positions , map < int , bool > & going_forward ) { int pos , last_layer ; cin >> pos ; while ( cin ) { cin >> firewall [ pos ] ; current_positions [ pos ] = 0 ; going_forward [ pos ] = true ; last_layer = pos ; cin >> pos ; } return last_layer ; }
For the input to be read correctly there must be no ':' between numbers.
For the input to be read correctly there must be no ' : ' between numbers .