ETrobocon2017 - 片山研究所モデルベース開発推進事業部
BoardAnalyzer.cpp
[詳解]
1 #include "BoardAnalyzer.h"
2 
4 {
5 
6 }
7 
9 {
10 
11 }
12 
13 // ubN̔zu̓void BoardAnalyzer::set(int* initPositions) { positions = initPositions; } // lp`̃ubҐ int BoardAnalyzer::getInLeftSquareCount() { int leftSquareCount = 0; for(int i=0; i<5; i++) { for(int j=0; j<5; j++) { if(positions[i] == leftSquare[j]) { leftSquareCount++; } } } return leftSquareCount; }
14 void BoardAnalyzer::set(int* initPositions)
15 {
16  positions = initPositions;
17 }
18 
19 // lp`̃ubҐ
21 {
22  int leftSquareCount = 0;
23  for(int i=0; i<5; i++)
24  {
25  for(int j=0; j<5; j++)
26  {
27  if(positions[i] == leftSquare[j])
28  {
29  leftSquareCount++;
30  }
31  }
32  }
33 
34  return leftSquareCount;
35 }
36 
void set(int *initPositions)
int getInLeftSquareCount()