# Robbers - square times square root

Task: Crack the scrambled code for multiplying the square root of an integer n by the square of it!

You must post a comment in the cops' thread with a link to your working source, mentioning clearly that you have Cracked it. In your answer's title, you must include the link to the original answer.

## Rules:

• You may only change the order of the characters in the original source.
• Safe answers cannot be cracked anymore.
• The other rules mentioned in the cops' thread
• Please edit the answer you crack

## WINNER: Emigna - 10 submissons (had some trouble counting)

Honorable mentions: Notjagan, Plannapus, TEHTMI

# JavaScript (ES7), Neil

_26_=>_26_**6.25**.5


The hard part, of course, was figuring out what to do with all the extra characters. (And also not posting this solution in the wrong thread, like I accidentally did at first. Oopsie...)

• @SethWhite: I had to use all the characters that Neil used in his scrambled code, otherwise this wouldn't have been a valid crack. Commented Apr 4, 2017 at 17:39
• How does this work? Commented Apr 5, 2017 at 7:30
• @Arjun _26_=> defines an anonymous function taking one parameter called _26_ (variables may start with an underscore but not a number). Then the remainder is just using ** as Math.pow() to raise the input to the power of 2.5 (6.25 power 0.5).
– Joe
Commented Apr 5, 2017 at 9:24
• Ah! I was thinking that _26_ was something ES7 specific. Didn't know that variables can be in this form too! (I have never seen a variable without an alphabet). That was a very clever approach by @Neil. And you were very clever too in cracking it! Have your well-deserved +1! :) Commented Apr 5, 2017 at 10:01

# Python, 15 bytes, Mr. Xcoder

lambda x:x**2.5


Pretty simple. Just takes x and raises it to the 2.5th power.

## OCaml, 13 bytes, shooqie

fun f->f**2.5


Try it online!

• I was posting it right now! Cannot believe it! Good job! Commented Apr 3, 2017 at 17:39

# Python 3, 44 bytes, Kyle Gullion

Those *s were quite misleading. Very clever!

lambda i:i**(lambda o,r:o/r)(*map(ord,'i*'))


Due to the quite limited character set I would be very surprised if there were any other valid solutions beyond trivial renaming or reordering of arguments.

• You got me, nicely done! Commented Apr 12, 2017 at 14:58

# C++ (gcc), 100 bytes, Mr. Xcoder

#include<math.h>
#include"iostream"
using namespace std;int main(){float n;cin>>n;cout<<pow(n,2.5);}


Try it online!

• Well done! Please edit the answer you crack, because I cannot do it now! Commented Apr 3, 2017 at 17:15
• An anonymous user suggested an edit to save 8 bytes by removing the using and just doing int main(){float n;std::cin>>n;std::cout<<pow(n,2.5);} Commented Apr 3, 2017 at 20:27
• Save another byte #including <cmath> instead of math.h.:) Commented May 4, 2017 at 5:18

x=exp.(2.5*).log


A pointfree function named x. Usage: x 4 -> 32.0

# Inform 7, corvus_192

Cool, an Inform7 entry. :) I just had to give this one a try.

I'm pretty sure this is the intended solution:

R is a room.

To f (n - number): say "[n * n * real square root of n]".


Note that this solution only works if compiled with the Glulx back-end, due to the use of the real square root of function.

BTW, the double quotes and square brackets are actually unnecessary; just say n * n * real square root of n would work just as well. The periods at the end of the commands could be omitted, too; or we could keep the first period and get rid of the newlines instead. Other parts of the code we could trim away include the article "a" before "room" and the spaces before the parentheses and after the colon. Fortunately, since we've got a spare pair of brackets, we can always use them to comment out all these extra characters. ;) So this is a valid solution, too:

R is room.To f(n - number):say n * n * real square root of n[
" a . "
]


To test this solution interactively, it's convenient to append something like the following test harness to the code:

Effing is an action applying to one number.
Understand "f [number]" as effing.
Carry out effing: f the number understood.


After compiling and running the program, you can type e.g. f 4. f 6. f 9. f 25 at the > prompt and receive something like the following output:

Welcome
An Interactive Fiction
Release 1 / Serial number 170404 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

R

>f 4. f 6. f 9. f 25
32.0
88.18164
243.0
3125.0
>


BTW, I just noticed that Inform (or presumably, rather, Glulx) rounds the last decimal place of f 6 wrong: the correct value is much closer to 88.18163 than to 88.18164. Fortunately, I don't think this affects the correctness of the solution(s), especially since the challenge specified "any rounding mechanism of your choice". :)

• I'm sure I found an Inform 7 fiddle a while ago, but I can't find it when I search. Do you know if there is an online interpreter anywhere? Commented Apr 3, 2017 at 23:19
• @Flounderer: I don't really know of any. There are certainly online (even JS-based) players for the Glulx / Z-machine bytecode produced by the Inform 7 compiler, but I'm not aware of anything that would directly take plain Inform 7 source code and compile and run it online. The compiler / IDE is pretty easy to install, though; on Ubuntu Linux, it's as easy as apt-get install gnome-inform7. Commented Apr 3, 2017 at 23:37

## Mathematica, Greg Martin

f[y_]:=With[{x=
#&@@{#(#)#^(1/(1+1))&@y,#&@@@{1^(1),-1}}
},Print[#,".",IntegerString[Round@#2,10,3]]&@@QuotientRemainder[1000x,1000]]


Thanks for leaving the rounding stuff intact!

Explanation: #(#)#^(1/(1+1))&@y does the main work of multiplying y squared, aka y(y), and y's square root, y^(1/(1+1)). The #&@@@{1^(1),-1} bit is just junk to use up the other letters, and #&@@ picks out the useful bit from the junk.

# MATL, 12 bytes, Luis Mendo

10'U&+:'n/^P


Calculate 10/4 = 2.5 with 4 coming from string length. Use this as an exponent. P is a no-op here.

# NO, 41 bytes, This Guy

NOOOOOO?NOOOOOOOOOOO!nnOOOOO
NOOOOOOOO?no

• Really? Well at least I got my language known. Commented Apr 5, 2017 at 21:29
• @ThisGuy: You've made some fun languages :) Not terribly useful in general though ;) Commented Apr 5, 2017 at 21:30
• Look at the 2nd paragraph Commented Apr 5, 2017 at 21:33

y<-function(p)(p^(1/2)*p^2);


seems to be an anagram of funny(p1)-tio(^*^)/pc(2)<p2;

# Python 2, 60 bytes, Anthony Pham

print    (input()**(5.0/(2*5554448893999/5554448893840))-0)


Based on discarding characters through Python 2's float division (the default for / between integers).

# C, 50 bytes, Dave

double b(float \ufa2d){return pow(\ufa2d,25e-1);%>


Try it online!

This requires -lm compiler flag, but I don't know how it would be possible to solve this without it.

• correct, and almost exactly what I had (variable was named \uad2f on mine). Well done; I thought I'd left enough red-herrings in there to keep people busy a lot longer! Also the -lm flag wasn't needed for me using Clang (I'd have mentioned it!) but you're correct that strictly speaking it's required.
– Dave
Commented Apr 4, 2017 at 11:59

# R, Flounderer

This is a crack of the 33 bytes solution of @Flounderer

scan()^(floor(pi)-1/2)-sin(7*0e1)


Usage:

> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 4
2:
[1] 32
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 6
2:
[1] 88.18163
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 9
2:
[1] 243
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 25
2:
[1] 3125

• Yes, this is not the intended solution which involved sin(pi), but unfortunately it does work! +1 Commented Apr 4, 2017 at 21:13
• It was scan()^(-floor(-sin(pi)*2e17)/10) Commented Apr 5, 2017 at 21:38

# RProgN 2, ATaco

]2^\š*


Apparently StackExchange needs extra characters, so here you go.

• My solution was ]š\2^*, but they both work the same way. Commented Apr 4, 2017 at 23:21

# HODOR, 198, This Guy

Walder
Hodor?!
hodor.
Hodor, Hodor Hodor Hodor Hodor Hodor Hodor Hodor, Hodor Hodor,
hodor,
Hodor, Hodor Hodor Hodor Hodor Hodor Hodor, Hodor Hodor,
Hodor, Hodor Hodor Hodor, hodor!,
HODOR!!
HODOR!!!


Explanation:

Start
read input into accumulator
copy accumulator to storage
Do math, option 7(nth root), n=2
swap storage and accumulator
Do math, option 6(nth power), n=2
Do math, option 3(times), storage
output accumulator as a number
end


note: I had to make some modifications to the get interpreter to run on my machine (the one you have posted doesn't seem to accept lowercase h, among some other things)

Also, I don't seem to have enough rep to comment, so if someone could let @This Guy know, I would be grateful

I think this fixed the error, the code now starts with Walder instead of Wylis, which adds the extra byte

• Almost there. Had to change a mistake in my code so yours ins't quite right. Commented Apr 5, 2017 at 14:10
• fixed the start command
– wwj
Commented Apr 5, 2017 at 14:24
• Though that you had it but you went for a different method than me that uses the same number of bytes. Your answer would do what you wanted it to do but it isn't the same as mine. Also I had to change the name because of this so I made an edit to your posts. Commented Apr 5, 2017 at 14:26
• for clarification, does this still count as a crack, or do I need to match up exactly?
– wwj
Commented Apr 5, 2017 at 14:51
• I'm not exactly sure. I'm going to ask in the comments. +1 your solution is making me think really hard! Commented Apr 5, 2017 at 14:52

## C#, 172 bytes, raznagul

Hardest part was figuring out what to do with all the leftovers.

using System;using S=System.Console;class PMabddellorttuuv{static void Main(){S.Write(Math.Pow(double.Parse(S.ReadLine()),2.5));Func<double> o;int q=1,M=q*2,b,e;q*=(q*M);}}

• Nice! I got stuck on the leftovers as well. Didn't think to add them to the class name, doh!. Good job! Commented Apr 5, 2017 at 15:07
• +1 Not what I had intended, but very nice solution. ;) Commented Apr 5, 2017 at 15:16

# EXCEL, 26 Bytes pajonk

=SQRT(A1)*A1^2/1/ISNA(IP2)


A1 as input IP2 contain a second input with a #N/A Error in this case ISNA(IP2) belongs to 1

For an additional () we can do this

=SQRT(A1)*A1^2/ISNA(PI(1/2))

• Is second input allowed in such challenge? Commented Apr 5, 2017 at 15:11
• @pajonk The rules say "You can take input in any standard way" so I have assume that you make this trick with a second input Commented Apr 5, 2017 at 15:30
• @pajonk I have improve my post it could been that you have make a little mistake Commented Apr 5, 2017 at 16:12
• The standard way for taking one number is (I think) taking one input. In my opinion the second input would be unfair and against the rules. PS There's no mistake in number of brackets. Commented Apr 6, 2017 at 18:59
• @pajonk I can not use combinations with SIN and PI cause there are not enough brackets. =SQRT(A1)*A1^2/SIN(PI()/2) If you set the #NA Error through formating or something else I would see it as additional second input. SQRT and ISNA are the only two functions that make a little sense. But please ask the man who had developed the question Commented Apr 6, 2017 at 20:42

## Python 3.6, 64 bytes, Mr. Xcoder

php38af4r2aoot2srm0itpfpmm0726991i=     (lambda x:x**2.5*1*1/1);


Maybe not what was intended, but works ;)

$python3 Python 3.6.1 (default, Apr 4 2017, 09:36:47) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> php38af4r2aoot2srm0itpfpmm0726991i= (lambda x:x**2.5*1*1/1); >>> php38af4r2aoot2srm0itpfpmm0726991i(6) 88.18163074019441 >>> php38af4r2aoot2srm0itpfpmm0726991i(4) 32.0 >>> php38af4r2aoot2srm0itpfpmm0726991i(25) 3125.0  Not enough rep to comment on the cops' thread's answer yet, sorry... Would appreciate if someone could do it for me, thanks! • @Mr. Xcoder , as said above, can't comment on your post in the cops' thread, sorry about that :) Commented Apr 5, 2017 at 23:58 • Came to post a similar solution from math import pi as pp0012223467899;f=lambda x:x**2.5*1*(1)/1 just to see I've been beaten to the punch. I've added a link to this post on the cops thread for you. Commented Apr 6, 2017 at 1:43 # Röda, 28 bytes, fergusq f(n){push n^0.5,n^2|product}  # Python 2.7, Koishore Roy s=e=x=y=input()**0.5 print'%.3f'%(y**(5.0))  • Or y=x=e=s, both work :)) Good job anyways! Commented Apr 8, 2017 at 14:46 • Good job. :P Now I need to work on a new code. Darn! Commented Apr 9, 2017 at 8:47 # R, Flounderer This is a crack of @Flounderer's 31-byte solution: [.=function(])]^[(lh,9)  Ok that was a tough one. It creates a function called [.. The argument to the function is called ] which is elevated to power 2.5 by using the 9th element of the built-in time-serie lh ("a regular time series giving the luteinizing hormone in blood samples at 10 mins intervals from a human female, 48 samples." that is used as example in one of R's base packages). lh[9] is here on top of it replaced by its equivalent [(lh, 9). De-obfuscated by substituting f for the function name and n for the argument name, the function then becomes f=function(n)n^lh[9]. Usage: > [.=function(])]^[(lh,9) > [.(4) [1] 32 > [.(6) [1] 88.18163 > [.(9) [1] 243 > [.(25) [1] 3125  # Python 2, 44 bytes, Anthony Pham print int(raw_input())**(0+000000000000.5*5)  Takes input from raw_input, converts to int and raises to power 2.5 # JavaScript, fəˈnɛtɪk n=>n**("ggggg".length*2**(-"g".length))// ""((((((()))))))***,-...;;=====>Seeeeegggghhhhhhhhhilllnnnnnnorrrsstttttttttttu{}  Gets 5/2 through 5 times 2 to the negative first power, where 5 and 1 were received from the length of strings. Took the easy way out in a sense by commenting out the extraneous characters. ## C#, 112 bytes, Jan Ivan using System;class P{static void Main(){var b=Math.Pow(double.Parse(Console.ReadLine()),2.5);Console.Write(b);}}  # 05AB1E, 47 bytes, Okx ).2555BFHIJJKKKPQRS„cg…ghi…lsw…x}T…Áöž«‚¹n¹t*  Try it online! • Ah, I knew there would be a workaround the method I used to 'secure' the code. Well done! – Okx Commented Apr 4, 2017 at 11:21 • @Okx: Yeah, 05AB1E is very tricky to pad with extra code without making it bypassable. Commented Apr 4, 2017 at 11:27 • I'll see if I can make you a trickier one ;) – Okx Commented Apr 4, 2017 at 11:29 • @Okx: Looking forward to it :) I have an idea as well that I may try to implement after work ;) Commented Apr 4, 2017 at 11:31 ## Fireball, 8 bytes, Okx ♥²♥1Z/^*  Explanation: ♥²♥1Z/^* ♥² Push first input squared. ♥ Push first input again. 1Z/ Push 1/2 ^ First input to the 1/2th * Multiply square and root  Not sure if it works. I have currently no java on my laptop. :( • I don't think that will work. Easy fix though, so I'll give you the answer. You just need to swap the Z1 into 1Z. – Okx Commented Apr 4, 2017 at 11:21 • I was sure I did a mistake there. Updated. Commented Apr 4, 2017 at 11:22 # Haskell, 64 bytes, @nimi product.(<$>(($(succ.cos$0))<$>[(flip<$>flip)id$id,recip])).(**)  Try it online! That was a fun one. I first found product.(<$>(($succ(cos$0))<$>[id,recip])).(**) which behaves correctly and than had to fit flip flip <$> () \$ id . somewhere into it.

a222=function(s)(s**0.5)*s**2**1


Usage:

> a222=function(s)(s**0.5)*s**2**1
> a222(4)
[1] 32
> a222(6)
[1] 88.18163
> a222(9)
[1] 243
> a222(25)
[1] 3125

• Original: a=function(s)s**2*s**(0.125*2*2) Commented Apr 4, 2017 at 14:47

# 05AB1E, 22 bytes, P. Knops

n¹t*qA9¥="'?:@->%#[{!.


Try it online!

Explanation

n      # square of input
*   # times
¹t    # square root of input
q  # end program


The rest of the operations never get executed.
We could have done it without the q as well by having ? after the calculation and escaping the equality sign for example with '=.

• Was just doing it for fun :D Commented Apr 4, 2017 at 18:12
• @P.Knops: That's the best reason :) Commented Apr 4, 2017 at 18:56