Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kuashio committed Nov 30, 2022
1 parent 292b175 commit 566eb90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/06/Challenge/ch6_horseplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
// Returns: An STL vector of strings with the possible locations to move.
std::vector<std::string> knight_moves(std::string knight){
std::vector<std::string> moves;
int x, y;
x = knight[0] - 'a' + 1;
y = knight[1] - '0';
const int delta1[2] = {-1, 1};
const int delta2[2] = {-2, 2};

int new_x;
int new_y;
std::string new_loc = " ";

// Write your code here

Expand All @@ -25,7 +34,7 @@ std::vector<std::string> knight_moves(std::string knight){

// Main function
int main(){
std::string knight = "d5";
std::string knight;

std::cout << "Enter the location of the knight: " << std::flush;
std::cin >> knight;
Expand Down
2 changes: 1 addition & 1 deletion src/06/Solution/ch6_horseplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ std::vector<std::string> knight_moves(std::string knight){

// Main function
int main(){
std::string knight = "d5";
std::string knight;

std::cout << "Enter the location of the knight: " << std::flush;
std::cin >> knight;
Expand Down

0 comments on commit 566eb90

Please sign in to comment.