diff options
| -rw-r--r-- | challenge-192/aecepoglu/README | 2 | ||||
| -rw-r--r-- | challenge-192/aecepoglu/bqn/ch-1.bqn | 11 | ||||
| -rw-r--r-- | challenge-192/aecepoglu/bqn/ch-2.bqn | 15 |
3 files changed, 28 insertions, 0 deletions
diff --git a/challenge-192/aecepoglu/README b/challenge-192/aecepoglu/README index ac1444b698..9e57c3a464 100644 --- a/challenge-192/aecepoglu/README +++ b/challenge-192/aecepoglu/README @@ -1 +1,3 @@ Solution by AhmetEmre + +Solved live on twitch.tv/slippygoat diff --git a/challenge-192/aecepoglu/bqn/ch-1.bqn b/challenge-192/aecepoglu/bqn/ch-1.bqn new file mode 100644 index 0000000000..6a3d34db78 --- /dev/null +++ b/challenge-192/aecepoglu/bqn/ch-1.bqn @@ -0,0 +1,11 @@ +# Two numbers (A, B) are their binary complements +# They will sum up to a N: (A + B = N) +# where N = (2⋆k)-1, +# where k is the number of bits required to represent A +# +# So first we find how many bits are required (A in log_2 rounded up) +# Then we find the value of N +# And we subtract from N our A +F←(⌈⌾(2⊸⋆⁼1⊸+))⊸- +2 = F 5 +7 = F 8 diff --git a/challenge-192/aecepoglu/bqn/ch-2.bqn b/challenge-192/aecepoglu/bqn/ch-2.bqn new file mode 100644 index 0000000000..ddd449cb2c --- /dev/null +++ b/challenge-192/aecepoglu/bqn/ch-2.bqn @@ -0,0 +1,15 @@ +# Likely some group theory at play here +# Given A, B, C +# A->C ≡ {A->B, B->C} +# But this doesn't help me with anything practical +# +# +# Find the deviation +# Apply effective diffs to it +# (by decrementing positive vals and incrementing negative vals) +# until solution found +F←{G←{·‿x:0≠+´x?¯1‿x + ;n‿x: 𝕩+d⋈˜|-´/|d←-∊⊸××x} + ⊑ G •_while_ {n‿x:(n≥0)∧(∨´0≠x)} 0⋈ (≠⥊+´÷≠)⊸- 𝕩} +4 = F 1‿0‿5 +¯1 = F 1‿0‿0 |
