Josif_tepe

Untitled

Apr 16th, 2022
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.63 KB | None | 0 0
  1. /* Code generated && tested by LizardCode for CodeFu */
  2. #include <limits.h>
  3. #include <vector>
  4. #include <sstream>
  5. #include <iostream>
  6. #include <algorithm>
  7. #include <cstring>
  8. #include <string>
  9. #include <cstdlib>
  10. #include <cstdio>
  11. #include <map>
  12. #include <list>
  13. #include <queue>
  14. #include <set>
  15.  
  16. using namespace std;
  17.  
  18. class ChessMaze
  19. {
  20.   public:
  21.  
  22.     int traverseMaze( vector<string> maze )
  23.     {
  24.      
  25.      
  26.     }
  27. };
  28.  
  29. const int Test_No=0;
  30.  
  31. int main()
  32. {
  33.   ChessMaze tmp;
  34.   int res;
  35.   vector<string> *maze;
  36. /***************************Test 1 ********************************/
  37.  
  38. if(Test_No==0 || Test_No==1){
  39. string ABC0[]={"..E.K",".S*.."};
  40. maze= new vector<string> (&ABC0[0],&ABC0[2]);
  41. res = tmp.traverseMaze(*maze);
  42. if(res == 2) cout<<"test #"<<1<<" Correct!\n\n";
  43.   else {cout<<"test #"<<1<<" Wrong!\n";
  44. cout<<"Expected: "<<2<<"\n";
  45. cout<<"Recieved: "<< res <<" \n\n";}
  46. cout<<"---------------------------------------------"<<"\n";
  47.  
  48. }
  49. /******************************************************************/
  50.  
  51.  
  52. /***************************Test 2 ********************************/
  53.  
  54. if(Test_No==0 || Test_No==2){
  55. string ABC1[]={".SE","KKK"};
  56. maze= new vector<string> (&ABC1[0],&ABC1[2]);
  57. res = tmp.traverseMaze(*maze);
  58. if(res == 1) cout<<"test #"<<2<<" Correct!\n\n";
  59.   else {cout<<"test #"<<2<<" Wrong!\n";
  60. cout<<"Expected: "<<1<<"\n";
  61. cout<<"Recieved: "<< res <<" \n\n";}
  62. cout<<"---------------------------------------------"<<"\n";
  63.  
  64. }
  65. /******************************************************************/
  66.  
  67.  
  68. /***************************Test 3 ********************************/
  69.  
  70. if(Test_No==0 || Test_No==3){
  71. string ABC2[]={"K.",".S","..",".*","*E"};
  72. maze= new vector<string> (&ABC2[0],&ABC2[5]);
  73. res = tmp.traverseMaze(*maze);
  74. if(res == 5) cout<<"test #"<<3<<" Correct!\n\n";
  75.   else {cout<<"test #"<<3<<" Wrong!\n";
  76. cout<<"Expected: "<<5<<"\n";
  77. cout<<"Recieved: "<< res <<" \n\n";}
  78. cout<<"---------------------------------------------"<<"\n";
  79.  
  80. }
  81. /******************************************************************/
  82.  
  83.  
  84. /***************************Test 4 ********************************/
  85.  
  86. if(Test_No==0 || Test_No==4){
  87. string ABC3[]={"..*E","K*SK"};
  88. maze= new vector<string> (&ABC3[0],&ABC3[2]);
  89. res = tmp.traverseMaze(*maze);
  90. if(res == 2) cout<<"test #"<<4<<" Correct!\n\n";
  91.   else {cout<<"test #"<<4<<" Wrong!\n";
  92. cout<<"Expected: "<<2<<"\n";
  93. cout<<"Recieved: "<< res <<" \n\n";}
  94. cout<<"---------------------------------------------"<<"\n";
  95.  
  96. }
  97. /******************************************************************/
  98.  
  99.  
  100. /***************************Test 5 ********************************/
  101.  
  102. if(Test_No==0 || Test_No==5){
  103. string ABC4[]={".E.KK","*K.S*"};
  104. maze= new vector<string> (&ABC4[0],&ABC4[2]);
  105. res = tmp.traverseMaze(*maze);
  106. if(res == 3) cout<<"test #"<<5<<" Correct!\n\n";
  107.   else {cout<<"test #"<<5<<" Wrong!\n";
  108. cout<<"Expected: "<<3<<"\n";
  109. cout<<"Recieved: "<< res <<" \n\n";}
  110. cout<<"---------------------------------------------"<<"\n";
  111.  
  112. }
  113. /******************************************************************/
  114.  
  115.  
  116. /***************************Test 6 ********************************/
  117.  
  118. if(Test_No==0 || Test_No==6){
  119. string ABC5[]={"*E.**","*..SK","****.","..***"};
  120. maze= new vector<string> (&ABC5[0],&ABC5[4]);
  121. res = tmp.traverseMaze(*maze);
  122. if(res == 3) cout<<"test #"<<6<<" Correct!\n\n";
  123.   else {cout<<"test #"<<6<<" Wrong!\n";
  124. cout<<"Expected: "<<3<<"\n";
  125. cout<<"Recieved: "<< res <<" \n\n";}
  126. cout<<"---------------------------------------------"<<"\n";
  127.  
  128. }
  129. /******************************************************************/
  130.  
  131.  
  132. /***************************Test 7 ********************************/
  133.  
  134. if(Test_No==0 || Test_No==7){
  135. string ABC6[]={".*","EK",".K","S."};
  136. maze= new vector<string> (&ABC6[0],&ABC6[4]);
  137. res = tmp.traverseMaze(*maze);
  138. if(res == 2) cout<<"test #"<<7<<" Correct!\n\n";
  139.   else {cout<<"test #"<<7<<" Wrong!\n";
  140. cout<<"Expected: "<<2<<"\n";
  141. cout<<"Recieved: "<< res <<" \n\n";}
  142. cout<<"---------------------------------------------"<<"\n";
  143.  
  144. }
  145. /******************************************************************/
  146.  
  147.  
  148. /***************************Test 8 ********************************/
  149.  
  150. if(Test_No==0 || Test_No==8){
  151. string ABC7[]={".*.",".**","ES.","...",".KK"};
  152. maze= new vector<string> (&ABC7[0],&ABC7[5]);
  153. res = tmp.traverseMaze(*maze);
  154. if(res == 1) cout<<"test #"<<8<<" Correct!\n\n";
  155.   else {cout<<"test #"<<8<<" Wrong!\n";
  156. cout<<"Expected: "<<1<<"\n";
  157. cout<<"Recieved: "<< res <<" \n\n";}
  158. cout<<"---------------------------------------------"<<"\n";
  159.  
  160. }
  161. /******************************************************************/
  162.  
  163.  
  164. /***************************Test 9 ********************************/
  165.  
  166. if(Test_No==0 || Test_No==9){
  167. string ABC8[]={"...*.","..***","...K*","S*E**"};
  168. maze= new vector<string> (&ABC8[0],&ABC8[4]);
  169. res = tmp.traverseMaze(*maze);
  170. if(res == 4) cout<<"test #"<<9<<" Correct!\n\n";
  171.   else {cout<<"test #"<<9<<" Wrong!\n";
  172. cout<<"Expected: "<<4<<"\n";
  173. cout<<"Recieved: "<< res <<" \n\n";}
  174. cout<<"---------------------------------------------"<<"\n";
  175.  
  176. }
  177. /******************************************************************/
  178.  
  179.  
  180. /***************************Test 10 ********************************/
  181.  
  182. if(Test_No==0 || Test_No==10){
  183. string ABC9[]={".*..","*.K.","KS.*","*KE*"};
  184. maze= new vector<string> (&ABC9[0],&ABC9[4]);
  185. res = tmp.traverseMaze(*maze);
  186. if(res == 2) cout<<"test #"<<10<<" Correct!\n\n";
  187.   else {cout<<"test #"<<10<<" Wrong!\n";
  188. cout<<"Expected: "<<2<<"\n";
  189. cout<<"Recieved: "<< res <<" \n\n";}
  190. cout<<"---------------------------------------------"<<"\n";
  191.  
  192. }
  193. /******************************************************************/
  194.  
  195.  
  196.   return 0;
  197.  
  198. }
  199.  
Add Comment
Please, Sign In to add comment