Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jan-g/junk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: BrisFunctional/2x2x2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on May 29, 2013

  1. make the example fns a bit clearer

    Matthew Gilliard committed May 29, 2013
    Copy the full SHA
    a0eed71 View commit details
  2. tidy up example fns (again)

    Matthew Gilliard committed May 29, 2013
    Copy the full SHA
    1739878 View commit details
  3. Update README.md

    Matthew Gilliard committed May 29, 2013
    Copy the full SHA
    33781b0 View commit details
Showing with 12 additions and 8 deletions.
  1. +3 −3 README.md
  2. +9 −5 rubiks.clj
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
junk
====
2x2x2
=====

Another look at the mechanics of a shared working environment for BrisFunctional workshops
Solving small Rubik's cubes
14 changes: 9 additions & 5 deletions rubiks.clj
Original file line number Diff line number Diff line change
@@ -57,8 +57,12 @@
(defn generate-undo-seq [fs]
(mapcat (partial repeat 3) (reverse fs)))

(do
(println "===================")
(let [moves [:F :U :D :R :L]]
(print-cube (apply-moves (apply-moves initial moves) (generate-undo-seq moves))))
)

(let [moves [:F :U :D :R :L]
moved-cube (apply-moves initial moves)
undo-moves (generate-undo-seq moves)
solved-cube (apply-moves moved-cube undo-moves)]

(print-cube initial)
(print-cube moved-cube)
(print-cube solved-cube))