Skip to content

Commit

Permalink
move ops to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Coppertine committed Jul 5, 2023
1 parent 5022200 commit 86cfc7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/b64/functions/math/bitwise/and.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Credit: phi
# https://github.com/MinecraftPhi/MinecraftPhi-modules/tree/master/phi.bitwise/src/datapack/data/phi.bitwise/functions
from bolt_expressions import Scoreboard
from ../pow import pow
from b64:pow import pow
score = Scoreboard("b64.math")
# Apparently, phi attmempts to multiply a and b by 2 until it overflows.
output = score["$output"]
Expand Down
2 changes: 1 addition & 1 deletion data/b64/functions/math/bitwise/rshift.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Credit: phi
# https://github.com/MinecraftPhi/MinecraftPhi-modules/tree/master/phi.bitwise/src/datapack/data/phi.bitwise/functions
from bolt_expressions import Scoreboard
from ../pow import pow
from b64:pow import pow
score = Scoreboard("b64.math")
a = score["$a"]
b = score["$b"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from bolt_expressions import Scoreboard
from ../pow import pow
import sys
from b64:pow import pow

score = Scoreboard("b64.math")
# inputs: $a, $b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def pow(base, exp):
_exp = exp
_result = 1

if score var _exp matches 1.. function ./exp:
if score var _exp matches 1.. function ./math/exp:
_result *= _base
_exp -= 1

if score var _exp matches 1..
function ./exp
function ./math/exp

_output = value["$" + next(identifiers)]
_output = _result
Expand Down

0 comments on commit 86cfc7b

Please sign in to comment.