Guest User

Untitled

a guest
Nov 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. |0 0 0|
  2. |0 0 0| (0 is empty, 1 is generated block)
  3. |0 0 1|
  4. _ _ _ Bottom->Mid Right->Mid Top->Mid Left->Mid
  5. |0 0 0|0 0 0|0 1 0| |1 0 0| |1 1 0| |1 1 1| |1 1 1|
  6. |0 0 0|0 0 0|0 1 1| |1 0 0| |1 1 1| |1 1 1| |1 1 1| -> Win! Generate
  7. |1 0 0|0 0 0|0 1 1| |0 0 0| |0 1 1| |0 1 1| |1 1 1| another game.
  8. _ _ _
  9. |0 0 0|
  10. |1 0 0|
  11. |1 0 0|
  12.  
  13. // (left->right, top->right->botttom->left, top... it doesn't have to be all 4 directions)
  14. Random the right direction order.
  15.  
  16. Generate all possible coordinates from all the directions from the path above.
  17. Initialize an empty list to store all chosen coordinates.
  18.  
  19. While(!(Generate enough x*x block))
  20. {
  21. Remove one coordinate from all possible coordinates and add it into chosen list.
  22.  
  23. if (!(Perform a check with the right order and the chosen list.))
  24. Remove it from the chosen list.
  25.  
  26. }
  27.  
  28. |0 0 0| |0 0 1|
  29. |0 0 1| |0 0 1|
  30. |0 0 1| |0 0 1|
  31. _ _ _ _ _ _
  32. |0 1 0|0 0 0|0 0 0| |0 1 0|0 0 0|0 0 0|
  33. |1 0 0|0 0 0|0 0 0| |1 0 0|0 0 0|0 0 0|
  34. |1 0 0|0 0 0|0 0 0| |1 0 0|0 0 0|0 0 0|
  35. _ _ _ _ _ _
  36. |0 1 0| |0 1 0|
  37. |0 1 0| |0 1 0|
  38. |0 0 0| |0 0 0|
  39. At this point the logic is wrong But if I add 1 more block to the
  40. with Top->Left->Bottom order. top grid, it'll become right.
Add Comment
Please, Sign In to add comment