Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int isLegalAction (Game g, action a){
- int flag = TRUE //returned true if test is passed.
- //Checks for a valid action code
- while(a.actionCode =< 7 && a.actionCode >= 0){
- flag = TRUE;
- }
- //Checks to see if inputted chars are allowed, ie. L, R, B
- if(a.actionCode == 3 && ){
- int counterLegalInput = 0;
- while(a.destination[counterLegalInput] != '\0'){
- if((a.destination[counterLegalInput] != "L" || a.destination[counterLegalInput] != "R" ||
- a.destination[counterLegalInput] != "B") && flag == TRUE){
- flag = FALSE;
- }
- }
- checks to see if path is ok, one stage at a time
- int charCounter = 0;
- int destLen = strlen(destination);
- while((charCounter <= destLen) && flag == TRUE){
- char testPath[charCounter + 1] = a.destination[0];
- int i = 1;
- while( i <= charCounter){
- strcat(testPath, a.destination[i]);
- }
- coord testPlace = convertPathToPoint(testPath);
- if(testPlace.x < oob1x &&)
- }
- }
- return flag;
- }
Advertisement
Add Comment
Please, Sign In to add comment