Commits

Shlomi Fish committed 71d2c5c

Get rid of trailing space.

Comments (0)

Files changed (1)

black-hole-solitaire/all-in-a-row-c-solver/black_hole_solver.c

 
 #include "alloc.h"
 
-typedef struct 
+typedef struct
 {
     /*
      * TODO : rename from board_values.
 
     bhs_state_key_value_pair_t * states_in_solution;
     int num_states_in_solution, current_state_in_solution_idx;
-    
+
     long iterations_num, num_states_in_collection, max_iters_limit;
 } bhs_solver_t;
 
         case 'A':
             *foundation = 0;
             break;
-        
+
         case '2':
             *foundation = 1;
             break;
         case '5':
             *foundation = 4;
             break;
- 
+
         case '6':
             *foundation = 5;
             break;
- 
+
         case '7':
             *foundation = 6;
             break;
- 
+
         case '8':
             *foundation = 7;
             break;
- 
+
         case '9':
             *foundation = 8;
             break;
- 
+
         case 'T':
             *foundation = 9;
             break;
     const char * s, * match;
     bhs_solver_t * solver;
     int ret_code, col_idx;
-    
+
     solver = (bhs_solver_t *)instance_proto;
 
     s = board_string;
                     &(solver->board_values[col_idx][pos_idx]),
                     solver->initial_board_card_strings[col_idx][pos_idx]
                 );
-            
+
             if (ret_code)
             {
                 *error_line_number = 2+col_idx;
                 return ret_code;
             }
-            
+
             while ((*s) == ' ')
             {
                 s++;
         init_state->key.data[two_cols_idx] =
             (unsigned char)
             (
-              (solver->initial_lens[two_cols_offset]) 
-            | (solver->initial_lens[two_cols_offset+1] << 4)    
+              (solver->initial_lens[two_cols_offset])
+            | (solver->initial_lens[two_cols_offset+1] << 4)
             )
             ;
     }
                     card = solver->board_values[col_idx][pos-1];
                     next_state = state;
                     next_state.key.foundations = card;
-                    next_state.key.data[BYTE_POS()] &= 
+                    next_state.key.data[BYTE_POS()] &=
                         (~(((1<<4)-1) << (BIT_OFFSET())));
                     next_state.key.data[BYTE_POS()] |=
                         ((pos-1) << (BIT_OFFSET()));
                     no_cards = FALSE;
 
                     card = solver->board_values[col_idx][pos-1];
-                    
+
                     if (abs(card-foundations)%(MAX_RANK-1) == 1)
                     {
                         next_state = state;
                         next_state.key.foundations = card;
-                        next_state.key.data[BYTE_POS()] &= 
+                        next_state.key.data[BYTE_POS()] &=
                             (~(((1<<4)-1) << (BIT_OFFSET())));
                         next_state.key.data[(col_idx>>1)] |=
                             ((pos-1) << (BIT_OFFSET()));
         max_num_states = 53;
 
         states = malloc(sizeof(states[0]) * max_num_states);
-        
+
         states[num_states] = (solver->final_state);
 
         while (memcmp(
                         sizeof(states[0]) * (max_num_states += 16)
                     );
             }
-         
+
             key_ptr = (bhs_state_key_value_pair_t *)&(states[num_states].value.parent_state);
             /* Look up the next state in the positions associative array. */
             bh_solve_hash_get(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.