Compare commits
3 Commits
v0.1
...
7ba21295ab
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ba21295ab | |||
| 2fd1a551be | |||
| 78268d78da |
@@ -3,7 +3,7 @@
|
||||
;; Copyright (C) Jonathan Lamothe
|
||||
|
||||
;; Author: Jonathan Lamothe <jonathan@jlamothe.net>
|
||||
;; Package-Version: 0.1
|
||||
;; Package-Version: 0.1.1
|
||||
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
@@ -35,13 +35,13 @@ MOVES represents the number of moves in the list."
|
||||
(defun cube-build-scramble (moves)
|
||||
"Generate a list of random moves for a 3x3 Rubik's cube
|
||||
|
||||
MOVES os the number of moves to generate. The algorithm will not
|
||||
MOVES is the number of moves to generate. The algorithm will not
|
||||
generate a sequence that moves the same face twice in a row."
|
||||
(let (result last-face)
|
||||
(while (> moves 0)
|
||||
(setq last-face (cube-random-face last-face))
|
||||
(push (cube-random-turn last-face) result)
|
||||
(setq moves (1- moves )))
|
||||
(setq moves (1- moves)))
|
||||
result))
|
||||
|
||||
(defun cube-random-face (&optional last-face)
|
||||
|
||||
Reference in New Issue
Block a user