Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TehPers committed Aug 17, 2017
1 parent 4d2d856 commit 7177254
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Unchanged from normal Cubically
| 5_ | `P`| `Q`| `R`| `S`| `T`| `U`| `V`| `W`| `X`| `Y`| `Z`| `[`| `\`| `]`| `^`| `_`|
| 6_ | `` ` `` | `a`| `b`| `c`| `d`| `e`| `f`| `g`| `h`| `i`| `j`| `k`| `l`| `m`| `n`| `o`|
| 7_ | `p`| `q`| `r`| `s`| `t`| `u`| `v`| `w`| `x`| `y`| `z`| `{`|`\|`| `}`| `~`| |
| 8_ | ``| ``| ``| ``| ``| ``| ``| ``| ``| ``| `×`| `÷`| ``| ``| ``| ``|
| 8_ | ``| ``| ``| ``| ``| ``| ``| ``| ``| ``| ``| ``| ``| `ċ`| ``| `Ċ`|
| 9_ | ``| `¹`| `²`| `³`| ``| ``| ``| ``| ``| ``| `¬`| `«`| `»`| | | |
| A_ | `𝟘`| `𝟙`| `𝟚`| `𝟛`| `𝟜`| `𝟝`| `𝟞`| `𝟟`| `𝟠`| `𝟡`| | | | | | |
| B_ | `½`| | | | | | | | | | | | | | | |
Expand Down
2 changes: 1 addition & 1 deletion cube.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Cube:index(x, y)
end

function Cube:solved()
return self:value(0) == 0 and self:value(1) == 18 and self:value(2) == 27
return self:value(0) == 0 and self:value(1) == self.size ^ 2 and self:value(2) == 2 * self.size ^ 2
end

local function rotateFace(cube, face)
Expand Down
10 changes: 2 additions & 8 deletions cubically.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ function C:exec(program)
self.didCommand = true
self.doElse = false
end
elseif self.codepage:faceindex(b) then
-- Face-valued index selection
error("Unexpected superscript")
elseif self.codepage:constindex(b) then
-- Constant index selection
error("Unexpected subscript")
elseif self.conditionFailed then
-- Command being skipped by a conditional

Expand Down Expand Up @@ -168,7 +162,7 @@ function C:value(n, index)
elseif n == 7 then
return self.input
elseif n == 8 then
return self.cube:solved() and 1 or 0
return self.cube:solved() and 0 or 1
else
return 0
end
Expand Down Expand Up @@ -295,7 +289,7 @@ C.commands = {
[')'] = function(self, n)
local label = table.remove(self.loops)
if label then
if (not n or n ~= 0) and (not label.args or table.iterator(label.args).any(function(arg) return self:value(arg) ~= 0 end)) then
if (not n or n ~= 0) and (not label.args or table.iterator(label.args):any(function(arg) return self:value(arg) ~= 0 end)) then
-- Jump to the `(`
self.ptr = label.ptr
return
Expand Down
2 changes: 1 addition & 1 deletion input.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
2
18 changes: 17 additions & 1 deletion program.cb
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
R'DR$:7+0"6
₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉
𝟘 𝟙 𝟚 𝟛 𝟜 𝟝 𝟞 𝟟 𝟠 𝟡
⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹
UR'UF'D2
■:𝟘

$:7(UR'UF'D𝟚-𝟙)6
(
D𝟚FU'RU'
:7(𝟛₂-𝟙)6
:7(𝟛₅-𝟙)6
:7(𝟛₂-𝟙)6
:7(𝟛₅-𝟙)6
𝟙₀
"8
#
)8

0 comments on commit 7177254

Please sign in to comment.