text:
Cops - square times square root
Note: This is the cops' thread, where one should post the scrambled code. Here is the robbers' thread where the cracked source should be posted and linked to the cop's answer.

Task: Write the shortest safe program which multiplies the square root of an integer n by the square of n
This is cops-and-robbers, so the rules are:

In your answer, post a scrambled version of your source code (the characters should be written in any order). The scrambled version should not work!
You can take input in any standard way, the same goes for output. Hardcoding is forbidden
After the code is cracked by the robbers (if this happens), you must mention that your code has been cracked in your title and add a spoiler to your answer's body with your exact code
The same applies to safe answers (mention that it's safe and add the spoiler)
The code is considered safe if nobody has cracked it in 5 days after posting it and you can optionally specify that in the title
You must specify your programming language
You should specify your byte count
You must state the rounding mechanism in your answer (see below)

You can assume that the result is lower than 232 and n is always positive. If the result is an integer, you must return the exact value with or without a decimal point; otherwise the minimum decimal precision will be 3 decimal places with any rounding mechanism of your choice, but can include more. You must state the rounding mechanism in your answer. You are not allowed to return as fractions (numerator, denominator pairs - sorry, Bash!)
Examples:
In -> Out

4 -> 32.0 (or 32)
6 -> 88.18163074019441 (or 88.182 following the rules above)
9 -> 243.0
25 -> 3125.0

The shortest safe answer by the end of April will be considered the winner.

Related. (Same CnR rules, different task.)

@MartinEnder If the task is the only thing differing, then isn't it a duplicate?

@NathanMerrill I don't know, I don't think we have any established duplicate guidelines for cops and robbers challenge, but if I ask a new [tag:code-golf] challenge, where the "only" thing that's different from a previous code golf is the task, it's usually not considered a duplicate. ;) (That said, I agree that CnRs are probably more interesting if we change up the CnR-part of the challenge, not the underlying task.)

@MartinEnder I personally think that the answers from the other challenge could be trivially modified to fit this challenge.  It has nothing to do with the tag IMO

@NathanMerrill I don't know about others, but none of my four answers could be reasonably reused for this challenge.

Good luck everyone! I am really glad that you have decided to reopen this. Looking forward to see interesting answers!

Is it okay if for large values there are rounding errors due to the inaccuracy of floating point numbers at that size?

@fəˈnɛtɪk yes, of course. The decimal precision really shouldn't matter that much for large values

Max expected input is 7131.55. It might be helpful to have that in the post.

I mentioned that the result is lower than 2^32, so I think it is not necessary @fəˈnɛtɪk

I had written my code to work for an input up to 2^32... Which is why I asked about rounding errors, got rather off the mark at that point

Do the robbers need to use the same rounding method as the cops?

Not necessarily, as long as it works @Leo

Can languages that do not natively support decimal numbers (Brainfuck, as an example) support only Integer output?

Well, that's kind of unfair @ATaco, but I will accept that if you specify in your answer.

Why is this tagged [tag:code-golf]?

@RomanGräf because the shortest safe answer wins

Oh, I only read the winning condition of the robbers thread.

@Mr.Xcoder: can the input be 0?

Yes, it can. The corresponding output is 0

@Mr.Xcoder: The rules already say "you can assume n is always positive" which to me means that 0 does not need to be handled. Are you sure you want to change it?

0 is considered positive for this challenge @tehtmi

@Mr.Xcoder: is there a constraint on the performance? As in, is it acceptable for an answer to take a somewhat longer time to return?

@user4867444 On a standard computer, it should not take longer than 15 seconds to execute

@Mr.Xcoder OK thanks

@Mr.Xcoder so no accepted answer?

05AB1E, 20 bytes - safe
Another totally different approach from my previous answers.
****++/133DDFPTs}¹¹Ð

No rounding.
Example runs
In   -> Out
0    -> 0
4    -> 32.0
6    -> 88.18163074019441
25   -> 3125.0
7131 -> 4294138928.896773

I have no doubt @Emigna is going to crack it in a jiffy, but eh, one has to try! :-D

Solution
D1TFÐ*D¹3*+s3*¹+/*}P

This is using the fact that this sequence:
u_0 = 1, u_{n+1} = u_n * (u_n ^ 2 + 3 x) / (3 u_n ^ 2 + x)
converges to sqrt(x), and cubically fast at that (sorry, didn't find how to format math equations in PCG).
Detailed explanation
D1TFÐ*D¹3*+s3*¹+/*}P
D1                   # Duplicate the input, then push a 1: stack is now [x, x, 1] (where x is the input)
  TF                 # 10 times (enough because of the cubic convergence) do
    Ð                # triplicate u_n
     *               # compute u_n ^ 2
      D              # and duplicate it
       ¹3*+          # compute u_n ^ 2 + 3 x
           s         # switch that last term with the second copy of u_n ^ 2
            3*¹+     # compute 3 u_n ^ 2 + x
                /    # compute the ratio (u_n ^ 2 + 3 x) / (3 u_n ^ 2 + x)
                 *   # compute u_n * (u_n ^ 2 + 3 x) / (3 u_n ^ 2 + x), i.e. u_{n+1}, the next term of the sequence
                  }  # end of the loop
                   P # compute the product of the whole stack, which at that point contains u_10 (a sufficiently good approximation of sqrt(x)), and the 2 copies of the input from the initial D: we get x ^ 2 * sqrt(x)

Try it online!

Python 3, 44 bytes (cracked)
'**:(((paraboloid / rabid,mad,immoral))):**'

No rounding. Floating point accuracy.

Come on, this deserves more points, it's so creative! There is symmetry, and all words are real words.

If I didn't make any silly mistakes... Cracked

MATL, 12 bytes (cracked by @tehtmi)
'Un&0P'/^:+1

No rounding; uses floating point.
Intended solution (different from that found by @tehtmi):

:&+n10U'P'/^

Explanation

:&+     % Create a matrix of size n × n, where n is implicit input
n       % Number of elements. Gives n^2
10U     % 10 squared. Gives 100
'P'     % 'P' (ASCII code 80)
/       % Divide. Gives 1.25
^       % Power. Implicit display

Crack?

@tehtmi Indeed! Well done! My intended solution was different; I just posted it

Röda, 28 bytes (Cracked by @tehtmi)
 (),.025^^cdfhnnnopprstuu{|}

Note the space at the beginning. No rounding, but it uses floating point numbers so precision is limited.

Is this an anonymous function, or a "full" function?

@KritixiLithos if the cop does not want to give clues, it is not supposed to

Cracked?

Perl, 42 bytes (Safe)
There are 41 bytes of code and -p flag (no other flags).
/"/4~~r..rso4r<_$4va=eg1de|i/h0-&$c={}l+"

The result isn't rounded (or rather rounded up to the same point Perl would have round up by doing $_ = (sqrt $_) * ($_ ** 2)).
Solution:

$_=eval".i44<4}{|~"=~s/./chr-10+ord$\&/gre
 (without the \ before the & - markdown spoiler seems to dislike $ followed by &)
Try it online!

Explanation:

 .i44<4}{|~ is $_**2*sqrt but with every character replaced by the character with its ascii code + 10. (ascii code of $ is 36, so it becomes . whose ascii code is 46, etc.).
 The purpose of s/./chr-10+ord$\&/gre is then to undo this transformation: it replaces each character by the character with ascii code 10 lower. (chr-10+ord$\& is probably clearer as chr(ord($\&)-10) where chr returns the character corresponding to an ascii code, and ord returns the ascii code corresponding to a character).
 finally, eval evaluates this string, and thus computes the result, which is stored in $_, which is implicitly printed at the end thanks to -p flag.

True. I was trying to edit quickly because I saw 4 reopen votes and hoped to get the question fixed before the 5th was cast. If the question had been left in the sandbox until it was ready, it would have been better for all involved.

@PeterTaylor Sure, no problem, and anyway it was bold so fairly visible (I wasn't blaming anyone, but merely pointing a minor flow (that I corrected right away (introducing typos in the process))). And I couldn't agree more about the sandbox part.

can you explain it a bit?

@LưuVĩnhPhúc You mean if I can give you a little bit of help to crack it? mmh... the code starts with $_=. And there is a eval somewhere. (that's not a lot but I feel I can't give you more without giving you too much information)

Octave, 43 bytes (Safe)
$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).
Solution:

eval(-[5,-2:3,-3:2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> )  % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5
How?
-[5,-2:3,-3:2]           % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7']   % This is a string: nlouu**$  concatenated with the number
.                        % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'
Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]
eval implicitly converts this to a string, and these numbers just so happens to be:
input('')^2.5

This was hard. Well done!

C, 50 bytes (Cracked by fergusq)
%(())   ,-12225;>\\aaabbdddeeefffllnoooprrttuuuuw{

Uses standard IEEE754 rounding. As noted by fergusq's answer, may require -lm depending on your compiler.

Cracked?

@fergusq correct, and almost exactly what I had. Well done; I thought I'd left enough red-herrings in there to keep people busy a lot longer!

@Dave Wow, that looks like a syntax error at first.

Swift - 64 bytes (Safe)
prot Fdnufi;nooitamunc xetgru(->atl)Ior:n{tFn pg,F(ao.o25t)(w)l}

No rounding, and displays a .0 even if the result is an integer.

Mathematica, 131 bytes, non-competing?, cracked
This has been cracked by @lanlock4! However, I still have internet points to bestow on someone who finds the original solution, where all the characters are actually needed....
f[y_]:=With[{x=@@@@@@#####^^&&&(((()))){{}}111111,,+-/y},Print[#,".",IntegerString[Round@#2,10,3]]&@@QuotientRemainder[1000x,1000]]

This is intended as a puzzle. Although you may use the above characters however you want, I certainly intend for the answer to follow the form
f[y_]:=With[{x=
    @@@@@@#####^^&&&(((()))){{}}111111,,+-/y
},Print[#,".",IntegerString[Round@#2,10,3]]&@@QuotientRemainder[1000x,1000]]

where the first and third lines are just a wrapper to make the rounding and display legal (it writes every output to exactly three decimal places, rounded), and the second line is the scrambled version of the guts of the code. Sample outputs:
6 -> 88.182
9 -> 243.000
9999 -> 9997500187.497

(Mathematica is non-free software, but there is a Wolfram sandbox where it is possible to test modest amounts of code. For example, cutting and pasting the code
f[y_]:=With[{x=
    y^2.5
},Print[#,".",IntegerString[Round@#2,10,3]]&@@QuotientRemainder[1000x,1000]]

defines a function, which you can subsequently call like f@6 or f[9], that does the same thing as the unscrambled version of the code above. So does this really have to be non-competing?)

Cracked it!

Ohm, 11 bytes
M ⁿ¡D¼½;+1I

Use with -c flag. Uses CP-437 encoding.

I'm sorry, but are you quite sure this is correct?

Now that no one has cracked it in the imparted time, mind sharing your solution please? I'm very curious :)

For now, this is the shortest answer considered safe. I will accept it, but if you do not post your original code in 5 days, I will uncheck this, since I am not sure this is possible. EAGER too see your solution

I've currently lost my solution. I will try to find it,but its in my old mobile which has a broken plug.

By the way, you generally don't need the -c flag in PPCG submissions unless you explicitly need to use a CP-437 encoded byte stream.

@RomanGräf try to find your solution, please. Otherwise I will uncheck this...

@RomanGräf : ping? Still very eager to see that solution :)

@Mr.Xcoder : how much longer are we going to wait for the solution?

He shared it, but has deleted that comment

@Mr.Xcoder : really? That's a shame... I'd very much like to see it, I tried to crack this thing for a good amount of time :)

@RomanGräf please repost your initial codr

@Mr.Xcoder : I must say it makes me a little sad that the accepted solution doesn't even bother giving its original code. One could have just posted some random short string and "won". Not very respectful of the time spent by the all the other people who played by the rules.

C#, 172 bytes (Cracked by SLuck49)
       (((((())))))***,,,,......1225;;;;;;<====>CFLMMMMMPPPRSSSSSWaaaaaaabbbbcccddddddeeeeeeeeeeegghiiiiiiiillllllmmnnnnnnnooooooooqqqqrrrssssssssstttttttttuuuuuuuvvwyy{{}}

This code is a full program.
There are seven space characters at the start.
The input is read form STDIN and printed to STDOUT. The result is in double, no rounding done.
Original Code ungolfed:
using System;
using S = System.Console;

class P
{
    static void Main()
    {
        var t = S.ReadLine();
        double q = int.Parse(t);
        Func<double, double, double> M = Math.Pow;
        S.Write(M(q, 2 * .25) * M(q * q, 1));
    }
}

Cracked

Haskell, 16 bytes (Cracked by @nimi)
()*...25=eglopxx

No particular rounding

R, 28 bytes (Cracked by @Flounderer)
funny(p1)-tio(^*^)/pc(2)<p2;

Standard R floating-point accuracy.

Is this it? http://codegolf.stackexchange.com/a/115132/26905

@Flounderer Yes, it is.

R, 19 bytes (Cracked by @Steadybox)
mensana(4*5*c(.1)):

Standard rounding
R, 33 bytes (Cracked by @plannapus)
(rofl(17)^coins(2*e)/pisan(10))--

R, 31 bytes (Cracked by @plannapus)
h=f`l`u`n`c`t`i`o`n([],[])^(.9)

Cracked the 19-byte answer.

Cracked the 33-byte solution.

Cracked the 31-byte solution!

Python 3.6, 59 bytes
ba(,b5,d' (,a/([m:'-)oa)(bl*aadplma dba](r)d )l*d,:)*m:-mml

No rounding. Floating point accuracy.

Really, 3 lambdas?

Fourier, 124  119 Bytes
((()))*******--011111<=>>>HHINNNN^^^eeehhhhkkkkmmmmmmmmmmmmmmmmossuuuuuuuuuuuuuuuuu{{{{{{{{{{}}}}}}}}}}~~~~~~~~~~~~~~~~

There are no whitespaces or newline characters.
Square root is rounded to the nearest whole number because Fourier doesn't seem to handle anything other than integers (and since @ATaco got permission, I hope this is ok)
fixed an editing mistake, if you were already cracking this, the previous was functional
Realized that I had misunderstood part of the code, and was using more characters than I needed to
If I missed anything let me know

Octave, 30 bytes (Safe)
(((((())))))**++/:@eeeiiijmsu~

A bit simpler than my first one. Shouldn't be too hard, but it's hopefully a fun puzzle.

No ^? Hmmm...

Came up with this @(e)(e**((i/(i+i))+~sum(e:j))) but it's only n^1.5...this one's tricky.

Python 2, 60 Bytes (Cracked by @notjagan)
 3n0)4  5)594p3(p5*5i9t4542)0/*((8(t.84- 90945 u)i*48/95n8r8

No rounding involved. Accurate up to 10 decimal digits.

Cracked!

Inform 7, 71 bytes (Cracked by @Ilmari Karonen)
""()**-..:[]
                 RT
aaaabeeeffilmmnnnnnooooooqrrrrrssstuuy

The code includes 17 spaces and 2 new lines.
This is a full Infrom 7 program defining a function that prints the result with a precision of 5 decimal places.

Cracked.

Haskell, 64 bytes, (cracked by Laikoni)
$$$$$$(((((())))))**,...0<<<>>>[]cccccdddeffiiiiilloopppprrsstuu

Standard Haskell floating point operations.
My original version is:

 product.((($succ$cos$0)(flip(**).)[id,recip])).flip(id)

Cracked!

@Laikoni: well done!

JavaScript (ES7), 20 bytes (Cracked by @IlmariKaronen)
****..22255666=>____

Standard JavaScript precision.

Cracked. (Oops, posted in the wrong thread at first.)

Such a clever approach! +1 :)

Octave, 42 bytes (Safe)
((((()))))+,,,-//01111111@[]^mnooorrssst~~

No rounding. Floating point accuracy.
Intended solution

 @(s)norm(roots([-1,~1,s^(10/(1+1))]),1/~1)

Try it online!

Was this close? f=@(s)s^norm(roots([1,2.5,1]),1)? I didn't find a way to make those remaining numbers and +-~~ become 2.5. I had some other attempts that were quite similar (changed the numbers a bit), but I couldn't get it correct.

@StewieGriffin It was! I have posted the intended solution

Python 3.6 - 52 bytes (Cracked by @xnor)
f=lambda x:x**125*77*8+8/5/((('aafoort.hipie.xml')))

Standard Python rounding

Cracked

Ruby, 35 bytes (cracked by xsot)
'a'0-a<2<e<2<l<3<v<4<4<4<5<5<6>7{9}

No rounding. Floating point accuracy.

Cracked

C#, 112 bytes  (cracked by Emigna)
     ((((())))),.....25;;;=CCLMMPPPRSWaaaaaaabbbccdddeeeeeeeeghiiiiiillllmnnnnnooooooorrrsssssssstttttuuvvwy{{}}

no rounding done
using System;
class P
{
    static void Main()
    {
        var b=double.Parse(Console.ReadLine());
        Console.Write(Math.Pow(b,2.5));
    }
}

Cracked

You are free to add more cops if you have more ideas, but you should post them in separate answers instead of adding to an existing one.

Ok: http://codegolf.stackexchange.com/a/115492/67504

05AB1E, 47 bytes
)*.2555BFHIJJKKKPQRST``cgghilnstwx}«¹¹Áöž‚„…………

Does not round, uses floating point accuracy.

Cracked

CJam, 8 bytes (Cracked by Enmigmna)
WYdYl##+

No rounding. Uses double precision.

Cracked

Fireball, 8 bytes (Cracked by Roman Gräf)
♥1Z*^²/♥

Does not round, uses floating point precision.
Code surrounded with hearts ;)
Should pretty easy to crack, once you have a look into Fireball.

Cracked

R, 32 bytes (Cracked by @plannapus)
i=na*0.5f*n(2*s*cos(t))*22*s*12u

Standard floating-point accuracy.

Cracked.

Excel, 26 bytes
=(())*//11122AAAIINPQRSST^

No rounding.
Note: As Excel is paid software, this works also in free LibreOffice

Is there a way to run this without buying Excel?  Currently it is the consensus that non free languages cannot be used in cops and robbers.

Should work in free Libreoffice, but I'll check and reach back.

Works just fine.

Cracked http://codegolf.stackexchange.com/questions/115034/robbers-square-times-square-root/115276#115276

@WheatWizard, not relevant anymore, but I think the consensus is: Non-free languages can be used, but should be marked as non-competing.

JavaScript + paper.js, 210 bytes (safe)
This one's fun. No comments for you, and no strings either.
paper.js is a vector graphics framework. This is a full program that takes input via a prompt and outputs graphically, because it's possible. There is no rounding and floating-point accuracy (I think).
Reference
Try code here
Math.tan(prompt(a,0));
leg Rave, ew(0,0),ectoPlasm = Real new qrt(;
marvin atTax M(en) in vr;tent * hat.o = Mat
nottet near(0a,a) w cgee;
brown.cern(lantern) ;( w 0,0.art;vict.o brace
r=v=,h.c.)an=.flClr= Cor0)

Edit: Just noticed (my fault for not reading properly)

The shortest safe answer by the end of April will be considered the winner.

Well, oops.
Original solution:
var a = prompt(0,0);
var r = new Rectangle(0,0,a,a).area;
var t = new Rectangle(0,0,Math.cbrt(a),Math.sqrt(Math.cbrt(a))).area;
var n = new PointText(view.center);
n.content = r * t;
n.fillColor = new Color(0);

Try code here

NO!, 41 bytes (Cracked by Emigna)
NOOO! NO! can finally compete! Although no-one will be bothered to crack this anyway :(
Anyway sigh here's the code:
NNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO??
nnno!

Full list of commands here.
Coded in Python so uses Python rounding.
NOOOOOOOOO!!!!!!!! Someone cracked it. (Curse you Emigna!) (just kidding!)

Introducing a new language will be fun ... Cannot wait ro strugle to crack it

Post another answer to NOT! mess up the two @ThisGuy

I think you mean "consonants" in your documentation (not constants).

@Dave D'oh! ☺

hmm, what's the canonical version of your interpreter for this challenge? Current master doesn't compile due to a typo on line 162 (there's also a typo on line 163 and missing self. on 149).

Guessing not required for this challenge, but bug report: the condition on 174 doesn't match the documentation: O on its own will be skipped, not interpreted as 0.1

@Dave corrected

Cracked?

Javascript, 123 bytes, Cracked by notjagan
 """"""((((((((()))))))))********,--.....//2;;======>>Seeeeeeegggggggggggghhhhhhhhhhhilllllnnnnnnnnnnorrrsstttttttttttttu{}

This code is a full function
There is one space character at the very start of the list of characters
The rounding of this answer is the floating point precision for Javascript, accuracy is within 10^-6 for every answer.
Got shorter because the precision didn't need to be maintained quite as high as I thought it did.
I had realized that it would be much easier to solve than I initially had made it but it was already there :P
Initial code:
g=t=>t-(t*t-n)/("le".length*t);e=h=>{n=h*h*h*h*h,s=2**(n.toString("ng".length).length/"th".length);return g(g(g(g(g(s)))))}

Newtons method, applied 5 times from the closest power of 2

OCaml, 13 bytes (Cracked by @Dada)
2*fn-5f>f*u .

No rounding (within IEEE 754 scope).

cracked.

Excel VBA, 59 bytes (Safe)
?(())*..//11124AAAAFPSW[[]]^acceehiiiiklnnnnoooppqrrstttttu

No particular rounding.
Uses the Immediate Window.

RProgN 2, 6 Bytes (Cracked by @notjagan)
š2]^*\

No rounding, displays many decimal places.
Does not display any for an integer solution.

Does this really perform n²√n? I can easily get it to calculate n² + √n, but I can't for the life of me see how you got the terms to multiply.

@notjagan me too... have been trying for 2 hours to crack it and nothing works. ATaco are you sure that the source is correct?

@Mr.Xcoder Ah, you're quite correct. Sorry for wasting your collective times! Please see the edited source.

Now it makes sense!

A bit late because I was busy, but cracked.

Lua 5.3, 110 bytes (safe)
((((()))))**,,,,,-....=====>~             aaaaaaaaacddddeeeffhhhiiiiiiilllmmnnnnnnooopppppprrrrrrrsssssssstttt

Calculations are standard using Lua numbers (ie double in common implementations). Tested using PUC-Rio interpreter. (I hope I didn't do anything bad, but I think it is reasonable...)
This is a full program with input from the command line.
Original solution:

 for a,r in pairs(math)do l,s=pcall(r,-math.pi)if s~=s and a>=(i or a)then i,p=a,r end end s=...print(s*s*p(s))

Explanation:

 math.sqrt is retrieved from the math library by looping through the math table and looking for functions that return NaN (and don't throw an error) when applied to negative pi. There are only a few functions like this, and sqrt is alphabetically last.

C, 115 bytes, (Cracked by @tehtmi)
""%&&((((((()))))))******++++,..//01122233388;;;;;;<====>>   bbbdddeeeefffggillllllllllnnnnnnnnoooooooooooprrtuuu{}

Notice that it does include 3 spaces.
Always outputs 3 exact decimals, rounded to the closest thousandth.
Should be rather fun to crack as it doesn't involve any built-in to compute powers or square roots, as opposed to most (cracked) solutions so far.
Example run (which also gives you a few small hints):
int main() {
  int n[] = {4, 6, 9, 25};
  for (int i = 0; i < 4; i++) {
    printf("%i => ", n[i]);
    o(n[i]);
    printf("\n");
  }
}

outputs:
4 => 32.000
6 => 88.182
9 => 243.000
25 => 3125.000

Tested with both gcc and clang, with no compilation flag needed.

It's been cracked; the original solution was
o(double n){long o=2.303e18+(*(long*)&n>>1);double l=*(double*)&o;for(o=2;o++<8;)l=(l+n/l)/2;printf("%.3f",l*n*n);}

which uses a magic constant in the same spirit as the infamous fast inverse square root algorithm to do just a handful of Newton iterations (as opposed to several thousands in the cracked solution)

It could actually be 3 bytes shorter, at a cost of completely sacrificing performance though :) (as in, becomes really, really slow)

Crack? Probably not exactly what you're going for, but maybe similar and I think it is okay.

@tehtmi not quite, see my comment there (your solution does not return correctly for input 0)

HODOR, 172 bytes, Cracked by Emigna
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!!!!!!!,,,,,,..?

let me know if I missed anything

Nope, this is scrambled

just approved your edit, I wrote this up last night... I think the interpreter I was using might have been out of date... I will need to check to make sure the code still works when I get home

I'm checking it now. See if I can crack it

Cracked

05AB1E, 35 bytes
ö£=s‰sr2xöR+RM0`.T"YVBYCDž„¨¨"6£H-L

This one took me a while to make.
There's some double quotes in there, so you can surround as much of the code as you want in them.
No rounding, decimal point precision.

05AB1E, 23 bytes (Cracked by Emigna)
A totally different approach than my previous answers :)
$++/02;@DDDGHP\rrszz}¹ž

No rounding.
Example runs
In   -> Out
0    -> 0
4    -> 32.0
6    -> 88.18163074019441
25   -> 3125.0
7131 -> 4294138928.8967724

Cracked

Dammit :-D ! This wasn't the intended solution, mine was $žHGDzrDz0@+2s/r+;}\¹DP, using the convergent sequences u_0 = 1, v_0 = x, u_(n+1) = 2 / (1/u_n + 1/v_n), v_(n+1) = (u_n + v_n) /2 to compute the square root. But very well done!

The thing is, it's hard to come up with an approximation method that can't be tweaked back into Newtons' iterations, mmh...

Oooh, that was a cool implementation. I figured my crack wasn't the intended :)

Javascript, 15 17 bytes, Cracked by @Emigna
(x=>x****-125*10)

Solution:

 x=>x**(25*10**-1)

Javascript, 18 bytes, Again, Cracked.
x=>x**-(!3.5++)[];

Solution:

 x=>x**(3-!+[]+.5);

Cracked. I was really wondering how to do it without the parenthesis ;)

Cracked 2nd

05AB1E, 23 bytes (Cracked by Emigna)
Another try
A9n*¥="'q?:@->%t#[{¹!.

Normal rounding

Cracked

05AB1E, 22 bytes, Cracked by user4867444
+/;DDDFLPT_nz}©®¹¹¹Ïè›

Example runs
In -> Out
0  -> 0
4  -> 32.0
6  -> 88.18163074019441

Original solution

LnD¹›_Ï®©èTFD¹/z+;}¹DP

Cracked!

Javascript (ES6), 39 bytes (Cracked)
(((())))*....57===>Mabcefghlllloprttxxx

The rounding is normal floating point precision for Javascript.

Cracked

HODOR, 198 bytes (Cracked by wwj)
NB: Had to correct the code!
Uses the brand-new hodor command (Updated Saturday)! Yes, I know I'm not supposed to say but it's pretty obvious anyway and (as far as I know) I'm the only person who can code in Hodor so worth some help :)
This is the code: and the full list of commands is here
H!HDHrlrHrhoooo!h, oo!do ordoH!oHHd
dodHrodorooooHdddoooOOo ddro roorrro.r,H
ooO ooHr,
HdHo oo H!O?Hd, oo,, Hdodhd oor, dd!HHrDo aod
rdroHdH,HrRr
 o o RHrdHoo,oro Hr
oo
oHoer o r oddodo,rr
rdd!WrH d

How do I run the Hodor interpreter?

@Emigna working on a file that will run from command line but for now will add a note in README (English version)

Is there perhaps a bug on row 118 in the interpreter? I can't get my program to work without changing that. Also, h should be in VALID_CHARS right?

@Enigma What version of Python are you using. I've fixed it btw

I was using python 3.

@Emigna Yeah it needs either [] or () around it to work

Let us continue this discussion in chat.

The link to HODOR is dead

Python 3.6 - 15 bytes (Cracked by Kritixi Lithos)
axx 2*d:b.*5mal

Standard rounding precision of Python

Cracked!

@KritixiLithos well done +1

C++, 100 bytes (Cracked by @fergusq)
#.leiha2dm"
tuchn"crmueie<linaatt#dso
fameng pcae sli;t>dt nnsiuno;s mnpti;ouic(<){n(a;>w<n>n)co.,5}

Standard C++ rounding precision

Cracked!

Python 2, 44 Bytes (Cracked by @fəˈnɛtɪk)
np5w***i0(0(0r0n0t+iarn00p0)_(0tu00i50.0)) t

Has accuracy up to 10 decimal digits (I think). No rounding involved and there is a space involved.

Cracked!

@fəˈnɛtɪk you should edit the answer you've cracked. Well done!

Scala, 19 bytes (Cracked by @math_junkie)
)>,/2(=addd.hmoptw5

This is a function of type Int=>Double.

Cracked!

C, 60 bytes (Cracked by @Dave)
1(root, flat*fat bern**lotr);pw(f{bus(--q.b4/q0*1-2)})(b>1)b

Standard C float accuracy.

Cracked: http://codegolf.stackexchange.com/a/115113/8927

05AB1E, 4 bytes (Cracked by @Mr. Xcoder)
Must be really easy to crack, but I'll still post it here
n*t¹

Normal rounding

bash, 158 bytes
This program requires a 64 bit processor to function. Pass input number as argument; result on stdout. I believe rounding is floor function. This program actually does decimal output. If you got integer only keep trying.
^=======|       -!
///////......
''(((((((((((())))))))))))
[]$$$$$$$$$****
\\\\\\
#++
000000000000
111111222
bcdddeeeehhhiill
nn
NNNNNNoooOOOOOOO
sssSSSS
tw

C#, 135 bytes (cracked by SLuck49)
      (((((()))))),,-..../11;;;CCEILMMMPPPRRSSWaaaaaaacccdddeeeeeeeeggghiiiiiiiillllmmnnnnnnnnoooooooorrsssssssssssttttttttuuuvwyy{{}}

no rounding done
(First try)

Cracked This was fun.

Javascript (ES7), 53 bytes (safe)
(((())))*++++,,,/0233346=====>>[[]]aaaabbbccelootttuv

The rounding is normal floating point precision for Javascript.
Tested this in the latest Chrome and FF.

Solution

 u=>(o=(t,c,a=o+c,b=a[t])=>eval(a[42]+b+b+3*30/t))(36)

 This works because a=o+c is '(t,c,a=o+c,b=a[t])=>eval(a[42]+b+b+3*30/t)undefined'.

   So a[42]='u', a[36]='*', 3*30/36=2.5, making eval('u**2.5').

Tests

var f=u=>(o=(t,c,a=o+c,b=a[t])=>eval(a[42]+b+b+3*30/t))(36);
console.log(f(0));    // 0
console.log(f(1));    // 1
console.log(f(2));    // 5.656854249492381
console.log(f(4));    // 32
console.log(f(10));   // 316.22776601683796

05AB1E, 15 bytes, (Cracked by Emigna)
+/01;DDDFMPs}¹ž

Normal rounding
Example runs
In   -> Out
0    -> 0
4    -> 32.0
6    -> 88.18163074019441
25   -> 3125.0
7131 -> 4294138928.896773

Cracked, right back at ya :P

@Emigna: eh, I figured it was only a question of time, same method ;) good job!

JavaScript (ES7), 24 bytes (Safe)
()+01488M``aabeiijlooqtv

Standard 64 bit floating point rounding.

Solution

 eval(atob`8j0+8ioqMi41`)

Tests

console.log(eval(atob`8j0+8ioqMi41`)(0));    // 0
console.log(eval(atob`8j0+8ioqMi41`)(1));    // 1
console.log(eval(atob`8j0+8ioqMi41`)(2));    // 5.656854249492381
console.log(eval(atob`8j0+8ioqMi41`)(4));    // 32
console.log(eval(atob`8j0+8ioqMi41`)(10));   // 316.22776601683796

Stacked, 64 bytes
:u#{`E2t#tv',lnp~.iuP#2qr+t,'3m3em`,#9''.::mluls on\ts r:a\:+.S0

Good luck.
Result for 6: 88.181630740194411535.

Maybe linking to https://github.com/ConorOBrien-Foxx/stacked would be more helpful.

@user4867444 If you click on "stacked" in the link above it gets your there anyhow.

Takes me to https://tio.run/nexus/stacked rather, which is not super helpful to learn about the language?

@user4867444 Perhaps my wording is confusing. On the tio.run page, clicking on "stacked" gets you to the github. Shown in this image Admittedly, it's a tad convoluted.

Python 2.7, 174 bytes
_cc*gnta(dkree_rtrto._i9kuc_ l5_r_cctbimWka(Wihlkeu_5_eur_rri_keeluc4clrp ..u_)(HohhH)ap5o(trbnord_ir9/*in)_clrikroap.ie.tg_obkfkseeeel*in2Hkdu*ffmo4lWlrncde_22);doodt a49 hu

05AB1E, 27 bytes - safe
Yet another totally different approach from my previous answers.
(/1DFFOOPT`ins}}©®¹¹Ðèëž‚‚‹

No rounding.
Example runs
In   -> Out
0    -> 0
4    -> 32.0
6    -> 88.18163074019441
25   -> 3125.0
7131 -> 4294138928.896773

Solution
Ð(‚žFFDO©n¹‹i`T/ë1è®s}‚}O¹P

This is simply computing the square root with a trivial (and very dumb) trial-and-error strategy...
Detailed explanation
Ð(‚žFFDO©n¹‹i`T/ë1è®s}‚}O¹P
Ð(‚                         # triplicate the input, reverse the sign of the last copy, and wrap the last 2 items in a list, which going forward is going to be the list of our current sqrt approximation and of the next decrement in our dumb search (so it starts at [x, -x])
   žFF                      # 16384(!) times, do
      D                     # duplicate the current [value, decrement] list
       O©                   # compute the sum value + decrement, and also save it in the register
         n                  # compute the square of that potential new approximation of the square root
          ¹‹                # and compare it with the input
            i               # if our new approximation is smaller than the actual square root, then
             `              # push the flattened [value, decrement] list to the stack as value, decrement
              T/            # and divide our decrement by 10
                ë           # else (our new approximation is still bigger than the actual square root, then)
                 1è         # extract the current decrement from the list
                   ®        # retrieve the new approximation from the register
                    s       # and switch them to again have them in the value, decrement order
                     }      # end of the if
                      ‚     # no matter which branch of the if we went into, the last 2 items of the stack are now the new approximation and the new decrement, in order: wrap them in a list for the next loop iteration
                       }    # end of the loop
                        O   # replaces the output of the loop (the final [value, decrement] list) by its sum, which given the very small value of the decrement at that point is pretty much the same as our final approximation of sqrt(x)
                         ¹  # push another copy of x; the stack is now [x, sqrt(x), x] (where the first x comes from the very first copy of the initial Ð)
                          P # computes the product of the whole stack

Try it online!

Java 7, 224 bytes (safe)
      ""&&((((((((()))))))))***++++++,,,,,,,-......//000000001113344556677;;;;;;;;;;<<======>>LLSS[\\\\\]aaaaaaaabbbbcccccccccdddddddddeeeeffffggggggiiiiiiiklllmmmnnnnnnnoooooooopprrrrrrssssssssssssstttttttttttuuuuuuuuvy{{}}

Look I know it's a lot of bytes but it's a full java program so you can expect a good portion of it to be basic boiler plate... and surely there are no tricks being employed. Output has 3 decimal places and operates the same as the examples in the challenge. I could probably make this harder but part of the fun is seeing how you end up breaking this and solving it in an unintended way. Good luck!
P.S. that's 6 spaces in case you're curious.
Example Runs
0    ->          0.000
4    ->         32.000
6    ->         88.182
25   ->       3125.000
7131 -> 4294138928.897

Solution:
class u{static double s,a,c,n,d,g,t;public static void main(String...u)\u007bd=Long.parseLong(u[0]);n=d/(c+++1);for(;g<(t=13);g++){for(;s<n;s+=c)if(s*s>d&&(s-=c)>0)break;c/=t;}System.out.format("\045\0563\146",s*d*d);}\u007d

Ungolfed:
class u{
static double s,a,c,n,d,g,t;               // static doubles default to 0.0
public static void main(String...u)\u007b  // had to use 1 or 2 unicode escapes for fun

d=Long.parseLong(u[0]);
n=d/(c+++1);                              // get d/2 while also making c=1

for(;g<(t=13);g++){                       // get 13 decimals of precision
  for(;s<n;s+=c)                          // increment the current decimal position
    if(s*s>d&&(s-=c)>0)break;             // square the current value and make sure we're still below the target
  c/=t;
}
System.out.format("\045\0563\146",s*d*d); // java also has octal string escapes
}
\u007d

Vyxal, 12 bytes, Cracked by lyxal
`25/n:([|eĖĖ

Have fun!

lol

Vyxal, 14 bytes
`25/$n:([|tėĖĖ

On to round 2!

Community has flagged this answer as a duplicate of your last answer btw.  Took me a while to spot the difference myself.

@GrainGhost I made a mistake in the previous, so did another one. I can see why this happened, it's not a big difference.

Python 2, 39 bytes (cracked by @Mr. Xcoder)
q=a(lxt)mh*mprf.hr
ax tttaixxmb :m*asod

Standard Python float rounding.

Cracked.

PHP, 61 Bytes (Safe)
No rounding
a$rians=)n$$/rnd=aa(*gt$)gg*g)(g)$(r|pg-n(+(;$r($)(tr)=r)ngq.

Original Solution
print($argn**(sqrt(((a|n).rd)($g=$argn==$argn))/($g+$g)-$g));

Python 2.7, 41 bytes
(sexypint=='pint')**(55.0)**fur==(.3%0%y)

rounding done by "%.3f"

Cracked!

C#, 179 bytes, safe
(((((((((((((())))))))))))))*****++,,,,,-..///////000000000111112222222222:;;;<=====>>>>?AFM[[[[[[[[[[[]]]]]]]]]]]abbbcdddddeeeeehllllnnnnnnnnnnnnnooooooooooorrrrrsttuuuuuww{{{}}}

There is no rounding. The code forms a lambda that takes an int and returns a double.

Solution
n=>{Func<double[],double>r=null;return(r=(o)=>(Math.Abs(o[1]-o[2])>=0.0000001)?r(new[]{o[0],o[2],(o[2]+(o[0]/o[2]))/2}):o[2])(new[]{n,(n*1d)/2,((n*1d)/2+(n/(n*1d)/2))/2})*(n*n);};

Exploded Solution
(int n) =>
{
    Func<double[], double>r = null;

    r = (double[] o) =>
    {
        if(Math.Abs(o[1]-o[2]) >= 0.0000001))
        {
            return r(new[]{ o[0], o[2], (o[2] + (o[0] / o[2])) / 2 });
        }
        else
        {
            return o[2];
        }
    };

    var initialO = new[]
    {
        n,
        (n * 1d) / 2,
        ((n * 1d) / 2 + (n / (n * 1d) / 2)) / 2
    };

    return r(initialO) * (n * n);
};

Python 3.6 - 64 bytes (Cracked by user4867444)
f1;7*x0d/2p6*mm1i*99 5 a o o t(a bphpx:m38af4r*1221=s2rm.0itlpa)

Extremely high precision. No rounding.
ORIGINAL SOLUTION:

 from math import pi as p;f=lambda x:x**(p**3/12.402510672119928)

Cracked!

@KyleGullion not very creative, but smart. I'll post the original solution shortly


text:
Am I Under Budget?
Am I under Budget?
Every 2 weeks when I get my cheque, I allocate a certain amount to last me until my next cheque, and bank the rest. To figure out how much I can spend per day and still remain under/on budget, I just need to divide the allocated amount by the number of days it needs to last me.
On Day 1 if the budget period is 14 days and I start with $400, I can spend ($400 / 14 =) $28.57 a day.
If I go over budget on any days though, I have less to spend during the rest of the budget period.
Say I spend $50 on Day 1. I now have $350 starting Day 2, and can only spend ($350 / 13 =) $26.92 a day instead of $28.57 for the remainder of the period.
Problem
Write a program/function that when given a starting allocation and a list of daily expenditures, returns a list of how much I could spend on each day to stay on budget, and a symbol indicating whether or not I was over/under/on budget that day.
Example
Pretend for this example the budget period is only 5 days.

Period Allocation = $100
Daily Expenditures = [20, 20, 30, 0, 0]

This should return (output variations are allowed. See Output section):
["= 20", "= 20", "^ 20", "V 15", "V 30"]

On Day 1, I can spend (100 / 5 =) $20. I spent the entire daily budget, so I was on budget (=). The first entry of the result is "= 20" to show this.

On Day 2, I can spend (80 / 4 =) $20. Again, I spent the entire amount, so the second result entry is the same as the first.

On Day 3, I can again spend (60 / 3 =) $20, but I went over budget by spending $30! I was allowed to spend $20, but went over, so the third result entry is "^ 20"; "^" meaning "over-budget.

On Day 4, I can spend (30 / 2 =) $15. I spent nothing however, so I was under budget. The fourth result entry will be "V 15"; "V" meaning "under-budget".

On Day 5, I can spend (30 / 1 =) $30. I again spent nothing and was under budget, so the fifth and final result entry is "V 30".

Input
Input will be:

A number representing the total money allocated for the period.
A sequence representing how much was spent on each day during the period

The number of days in a period is = to the length of the daily expenditure list.
Input Rules:

Your program must handle decimal allocation amounts.
The allocation amount can be taken as a number or string. A dollar sign is allowed for string representations (but optional).
You can assume the budget period will be at least a day long (daily expenditure list will contain at least 1 entry).
You can assume I won't spend more money than I allocated.
A delimited string would also be a acceptable form of input

Output
Output will be a sequence of symbols and numbers showing how much I was allowed to spend on that day, and whether or not I went over.
Output can be returned or printed to the stdout.
Output Rules:

Any non-numeric symbols can be used to indicate on/under/over budget, as long as you chose a different symbol for on, under and over. If you don't use "="/"V"/"^", make sure to specify in your answer what symbols you're using.

The symbol can appear before or after the number

Output can be any form of sequence where it's clear what parts belong to what day. The examples here use a sequence of strings, but a sequence of pairs/lists would be fine as well.

Output must be accurate to at least 2 decimal places (but more is fine). It must be properly rounded using 4/5 rounding if only accurate to 2 places.

A long string instead of a sequence of strings is fine too, as long as there's some delimiter separating output for each day so it's readable.

Test Cases
10, [1, 2, 3, 4, 0]
["V 2", "V 2.25", "^ 2.33", "^ 2", "= 0"]

25, [20, 2, 3]
["^ 8.3", "V 2.5", "= 3"]

1000, [123, 456, 400]
["V 333", "^ 438.5", "V 421"]

500, [10, 200, 0, 0, 100, 50, 50]
["V 71.43", "^ 81.67", "V 58", "V 72.5", "^ 96.67", "V 70", "V 140"]

This is code golf, so the smallest number of bytes wins.

are you sure of the last case? my code fails for only that!

@officialaimm I'll double check it. I was pretty caffeinated when I made  the second and forth cases.

It should be 71.43, 81.67,58,72.5,96.67,95,140

@fəˈnɛtɪk Your're right. Updating.

Wow my spelling sucks today.

Can I return a list of char/number pairs, e.g. [('^', 8.3), ('V', 2.5), ('=', 3)]?

@nimi Sure, that seems fine. I'll update the Output section.

Javascript, 67 66 bytes
a=>b=>b.map(c=>`v=^`[(c>(e=((a-=c)+c)/d--))-(c<e)+1]+e,d=b.length)

Explanation
This is an anonymous function that takes input through currying syntax (f(a)(b)). In this case, the fist number is the total budget, and b is an array of the money spent during the time period.
The function loops over b, but first sets d to the length of the array b. Then, for each element c in b, an inner function is executed (`v=^`[(c>(e=((a-=c)+c)/d--))-(c<e)+1]+e). This inner function calculates the budget for that day by dividing the amount left (a) by the number of days left (d). This results in 0 if the amount spent today is smaller than the budget, 1 if both are equal, and 2 otherwise. This is then used as index into a string with the correct symbols, and then the budget for this day is appended to that.
Afterwards, both the amount of money left and the number of days left are decreased; the former by c, the money spent on this day, and the latter by 1. It turned out that the shortest way to write this is to decrement a inside the division, and then add c to it, so the actual numerator is just a.
Usage
Uses currying syntax. There might be a really small error in the intermediate values, because of the way JavaScript deals with arithmetic.
Test it
Try all test cases here:

let f=
a=>b=>b.map(c=>`v=^`[(c>(e=((a-=c)+c)/d--))-(c<e)+1]+e,d=b.length)

let testcases = [[100, [20, 20, 30, 0, 0]], [10, [1, 2, 3, 4, 0]], [25, [20, 2, 3]], [1000, [123, 456, 400]], [500, [10, 200, 0, 0, 100, 50, 50]]];
for (let test of testcases) {
    console.log(`f(${test[0]})(${test[1].join(", ")}): ${f(test[0])(test[1])}`);
}

The output is fine. That was fast!

Python 3, 112 97 82 bytes
def f(a,b):
 l=len(b)
 for i in b:e=a/l;print('=v^'[(e>i)-(e<i)]+str(e));a-=i;l-=1

Try it online!

saved 15 bytes!!!! thanks to Luke
saved 15 bytes: removed unwanted variable r

('V'if(e>i)else'^'if(e<i)else'=') could be shortened to '^=v'[(e>i)-(e<i)], saving 15 bytes

Updated test cases.

That saved me 15, thanks a lot @Luke

I made a mistake in the order of the string: it should be =v^.

Röda, 65 bytes
f p,e{a=#e;e|{|b|x=p/a-b;[("=V^"/"")[x//x^2^0.5],p/a];p-=b;a--}_}

Try it online!
A simple imperative solution. Returns a letter and a number for each day. Uses x//x^2^0.5 to calculate the sign of x.
Functional programming version (76 bytes):
f p,e{seq#e,1<>e|[(p-sum(e[:#e-_]))/_1-_,_2]|[("=v^"/"")[_//_1^2^0.5],_1+_]}

Python 3, 77 bytes
def f(a,l):
 d=len(l)
 for i in l:e=a/d;d-=1;print('=v^'[(e>i)-(e<i)],e);a-=i

Try it online!

using '=v^'[(e>i)-(e<i)] save a chunk of bytes. Thanks to Luke.
Saved some bytes by assigning len(l) to a variable and then decrementing it instead od holding another variable.

You could make this into an anonymous function to save some  bytes.

Anonymous function in the sense, using lambda?

Yes. The functions don't need to be named. You can assume they'll be called appropriately.

I dont think I can use anonymous  function here. Lambda is a single line expression and I couldnt assign variables there. If that is not what you mean, can you please suggest some examples.

Haskell, 75 bytes
m#l@(a:b)=((,)=<<("V=^"!!).fromEnum.compare a$m/sum[1|x<-l]):(m-a)#b
_#_=[]

Usage example: 25 # [20, 2, 3] -> [('^',8.333333333333334),('V',2.5),('=',3.0)]. Try it online!
How it works:
m#l@(a:b)=                   -- if the list of spendings has at least one
                             -- element a, the result is
 (,)                         -- a pair of two times
         m/sum[1|x<-l]       --  m / <length of the input list>
                                 (the library function 'length' is of type 'Int',
                                 so I can't use it with '/')
    =<<                      --  but the first element is modified by
      ("V=^"!!).fromEnum.compare a
                             --  picking a char from the string "V=^"
                             --  depending on the result of comparing it to a
           :(m-a)#b          -- followed by a recursive call with all but the first
                             -- spending and m adjusted

_#_=[]                       -- base case: if the list of spendings is empty, the
                             -- result is also the empty list

Java (OpenJDK 8), 140 bytes
class B{void f(float a,float[]l){int d=l.length;for(float i:l){float e=a/d;d--;a-=i;System.out.format("%s%f ",(e<i)?'v':(e>i)?'^':'=',e);}}}

Try it online!
Ungolfed!
class B {
 void f(float a, float[] l) {
  int d = l.length;
  for (float i: l) {
   float e = a / d;
   d--;
   a -= i;
   System.out.format("%s%f ", (e < i) ? 'v' : (e > i) ? '^' : '=', e);
  }
 }
}

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
PowerShell: test connection in as few characters as possible
I need this down to as few characters as possible.  I would use Test-NetConnection but I need PSv2 compatability.  Any help would be appreciated.
$socket = new-object Net.Sockets.TcpClient
$socket.Connect("192.168.5.5",445)
$socket.Connected

As a note I have tried this but it doesn't work
(new-object Net.Sockets.TcpClient).Connect("192.168.5.5",445).Connected

My code does work.  I am proposing the challenge of "make it as few characters as possible".  I fail to see how this is considered "off topic" when one of the topics is "programming challenges".  Please explain....

@apsillers This is a perfectly on-topic question; we've accepted many "how can I make my code shorter" questions in the past: 1, 2, 3, 4, 5, 6, 7, 8, etc.

This would be better suited for The Nineteenth Byte or something. IMO, it doesn't warrant its own question on the main site.

@NickClifford This type of question, while uncommon, is absolutely on topic.

@NickClifford Viewed as a narrowly-applied [tips] question, rather than as a challenge, this is indeed on topic. (I say this as someone who originally voted to close the question.)

@apsillers Ah, I see.

OP, just to explain the contention here, the site accepts two types of posts: "challenges" to achieve some general goal ("Given a number as input, compute the lowest prime number higher than the input number" as one simple example) and "tips" which ask for help golfing in a particular language. "Tips" posts are comparatively rare, and are largely language-specific compendiums of knowledge (e.g., Tips for golfing in Windows PowerShell. However, tips-posts asking to golf a particular problem are allowed, but fairly uncommon, hence the confusion.

AFAIK, there's no default alias for New-Object, and no type accelerator for Net.Sockets.TcpClient, so they can't be any shorter. You can merge the constructor and connect code into one line:
(New-Object Net.Sockets.TcpClient -A 192.168.5.5,445)

But if it can't connect, it now throws an exception, which you can't silence with -ErrorAction. So handling that ends up being 70 characters, only 8 shorter than your original after shrinking the variable name:
!!$(try{(new-object net.sockets.tcpclient -A 192.168.5.5,445)}catch{})

!! forcing the result to a bool.

My final solution ended up taking parts from both of your answers:
While(!!(New-Object net.sockets.tcpclient (192.168.5.5,445))){}
Thank you both for your input!  I gave the answer to TesselatingHeckler's because I was impressed at the way he returned a bool value in only two characters.  Quite impressive!

PowerShell v2+, 63 bytes
You can use a different constructor to create the object and connect in one go.
(new-object Net.Sockets.TcpClient('192.168.5.5',445)).Connected

I've verified this works in v2 on my Windows 8.1 machine. That constructor is supported by .NET 2.0, so this should be v2 compatible.

Can replace '192.168.5.5' with 3232236805

@ceilingcat Can you explain that?

@MichaelTimmerman The integer 3232236805 is equal to 192256^3 + 168256^2 + 5*256 + 5, the native format that the TCP stack uses internally.

@ceilingcat Just tested this by pinging 192.168.1.1.  I would have never in a million years guessed that this would work lol.  I'll be sure to remember this.  Thank you for explaining :)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
This is how we roll
Piet is an interesting programming language for a number of reasons. Today we will focus on one reason: the roll command. The roll command was originally from PostScript and is a powerful way to manipulate the stack.
The roll command pops the top two elements of the stack and uses them as parameters. We'll call the first value popped turns and the second depth. A turn to depth n will take the topmost element of the stack, make it the nth element in the stack, and move each of the elements above it up one. If turns  is negative this is done in the opposite direction. That is, the nth element is moved to the top and the other elements are moved down. This is repeated abs(turns) times.
Challenge
Write a program or function that takes in a stack and returns that stack after executing a roll.
Rules

Input and output may be in a list, array, string with a delimiter, passed in one element at a time, or any other reasonable format. Output must be in the same format as the input.
depth will never be negative and will never be greater than the length of the stack.
The input stack will always contain at least two elements.
This is code-golf so the shortest answer in each language wins. As such, I will not be accepting an answer.
Standard loopholes are forbidden.

Test Cases
in:  out:
2
4
1    3
2    4
3    1
4    2
5    5
6    6

in:  out:
-2
3
1    2
2    3
3    1

in:  out:
-42
0
1    1
2    2
3    3
4    4
5    5

shortest answer in each language wins, that's not how [code-golf] works. Shortest answer wins. Period.

@mbomb007 ahem what about this

I was very disappointed that this did in no way involve rick rolling

@mbomb007 I don't see that in the tag description or in a quick search on meta so I don't think that is the case.

@DownChristopher The OP can specify that he's doing a catalog, but it's not the [code-golf] tag itself that makes it that. Code golf by itself simply means shortest wins. Considering that this isn't a trivial example worth cataloging, I'd recommend just doing shortest answer wins. "Hello, World!" is worth a catalog, but this isn't.

@mbomb007 If you would like me to change it, please provide some sort of argument other than saying "you're wrong and I'm right" over and over. There is precedent for this, which you dismissed, and nowhere does it say that challenges require exactly one winner or that an answer must be accepted.

"Questions without an objective primary winning criterion are off-topic, as they make it impossible to indisputably decide which entry should win." The precedent for a catalog is only for questions worth cataloging, as in, the question will receive hundreds of answers. A "hello world" question is such a question. This one isn't.

@mbomb007 If you think that this answer doesn't have an objective winning criterion just because I said I was not accepting an answer then you should vote to close it. No objections were raised in the sandbox but there could still be issues.
There isn't a strict definition of this "catalog" you keep bringing up and I even recall you taking catalog status away from a question. Since there is no clear definition of a catalog I don't see why this can't be one, even though we both deem it unnecessary.

Can we use Piet? :P

@Feathercrown Yes. Piet, PostScript and other languages with a roll builtin are allowed.

Haskell, 64 62 bytes
Edit: -2 bytes: @xnor saw something I'd thought wrong about.
r takes and returns a list of Ints.
r(t:d:l)|d<1=l|(x,y)<-d%l,(z,w)<-mod t d%x=w++z++y
(%)=splitAt

Try it online!
splitAt n l splits a list l at index n, mod calculates remainder of division, ++ concatenates lists.

I think you can cut 2 bytes by defining (%)=splitAt infix.

@xnor Oh, I had somehow convinced myself that wouldn't work

JavaScript (ES6), 49 47 bytes
(t,d,...a)=>a.splice(t=(t%d+d)%d,d-t).concat(a)

Edit: Saved 2 bytes thanks to @Shaggy by taking the stack elements as separate parameters. Explanation:

When the turn is a multiple of the depth, nothing happens. The first step is therefore to calculate turn modulo depth. As JavaScript only knows how to calculate the remainder, I have to do this in two steps.
A turn of 1 moves the top element to the depth element. A turn of 2 moves the top two elements, etc. However, you can also achieve this by moving the elements between turn and depth to the front. splice removes those elements and concat prepends them to the remaining elements. (I could have used an array comprehension instead as it is the same length.)
Unlike slice, the second parameter to splice is the number of elements to remove.

Isn't (t%d+d)%d the same as t%d?

@Luke No, % is remainder, so it gives a negative answer when t is negative.

You could save 2 bytes by using (t,d,...a)=> as the rules allow for the input to be passed in one element at a time.

@Shaggy Thanks, I hadn't noticed that.

CJam, 31 bytes
)\):N@\,0a|={NW*1$1$>)\+@@<\+}*

Input and output are arrays on the stack, with the last element representing the top of the stack.
Stack trace:
                   e# Stack:                [6 5 4 3 2 1 4 2]
)                  e# Take out first value: [6 5 4 3 2 1 4] 2
\                  e# Swap:                 2 [6 5 4 3 2 1 4]
)                  e# Take out first value: 2 [6 5 4 3 2 1] 4
:N                 e# Store in N:           2 [6 5 4 3 2 1] 4; N=4
@                  e# Rotate:               [6 5 4 3 2 1] 4 2
\                  e# Swap:                 [6 5 4 3 2 1] 2 4
,                  e# Range:                [6 5 4 3 2 1] 2 [0 1 2 3]
0                  e# Push 0:               [6 5 4 3 2 1] 2 [0 1 2 3] 0
a                  e# Wrap in array:        [6 5 4 3 2 1] 2 [0 1 2 3] [0]
|                  e# Logical or:           [6 5 4 3 2 1] 2 [0 1 2 3]
                   e# (This will replace an empty array with [0] to handle a special case of n=0)
=                  e# Get array value:      [6 5 4 3 2 1] 2
{NW*1$1$>)\+@@<\+} e# Push block:           [6 5 4 3 2 1] 2 {NW*1$1$>)\+@@<\+}
*                  e# Preform n times:      [6 5 4 3 2 1]
  N                e# Push N:               [6 5 4 3 2 1] 4
  W*               e# Negate:               [6 5 4 3 2 1] -4
  1$               e# Copy element 1 back:  [6 5 4 3 2 1] -4 [6 5 4 3 2 1]
  1$               e# Copy element 1 back:  [6 5 4 3 2 1] -4 [6 5 4 3 2 1] -4
  >                e# Slice a[-4:]          [6 5 4 3 2 1] -4 [4 3 2 1]
  )                e# Take first value:     [6 5 4 3 2 1] -4 [4 3 2] 1
  \                e# Swap:                 [6 5 4 3 2 1] -4 1 [4 3 2]
  +                e# Append:               [6 5 4 3 2 1] -4 [1 4 3 2]
  @@               e# Rotate twice:         [1 4 3 2] [6 5 4 3 2 1] -4
  <                e# Slice a[:-4]:         [1 4 3 2] [6 5]
  \                e# Swap:                 [6 5] [1 4 3 2]
  +                e# Append:               [6 5 1 4 3 2]
e# Preform the block again:                 [6 5 2 1 4 3]

Ruby, 40 bytes
x=->s{n,d,*s=s;s[0,d]=s[0,d].rotate n;s}

Try it online!
Takes the input as a list, returns a list. The fact that a built-in rotate exists which can handle both positive and negative rotations makes this trivial.

Mathematica, 58 50 bytes
Edit: Thanks to Martin Ender for saving 8 bytes.
Take[x={##3},#2]~RotateLeft~#~Join~Drop[x,#2]&@@#&

Explanation:
Pure function which expects a list where the beginning of the list represents the top of the stack. We pass the elements of the list into the pure function Take[x={##3},#2]~RotateLeft~#~Join~Drop[x,#2]&. x is set to the sequence of elements starting with the third argument., then we rotate the first #2 (second argument) elements of x to the left # (first argument) times, then Join the remaining elements of x.
It would save 3 bytes if we just passed the stack elements in as arguments to the function directly rather than being in a list initially, but then the input and output formats wouldn't match.
Original solution:
#/.{t_,d_,x___}:>{x}~Take~d~RotateLeft~t~Join~Drop[{x},d]&

There's something really satisfying about this chain of infix functions. Replaces a list with first element t, second element d, and remaining elements x with the result of rotating the first d elements of {x} to the left t times and joining the remaining elements of {x}.

Nice! You can save 3 bytes by using a one-byte prefix function ± insetad of a replacement rule, and another 1 byte by exploiting TakeDrop as follows:
±{t_,d_,x___}:=#~RotateLeft~t~Join~#2&@@{x}~TakeDrop~d

I was just going to comment the same thing as Greg, but you can actually go even shorter. Either make an unnamed variadic function (although that's a bit dodgy because it takes input ...&[1, 1, 3, 4] and return {3, 4} or do that manually with an Apply in the beginning: Take[x={##3},#2]~RotateLeft~#~Join~Drop[x,#2]&@@#& (just to be clear, my first suggestion omits the @@#&.)

Python, 141 98 87 74 bytes
11 bytes saved thanks to @Cole
def f(s):*s,d,t=s;n=len(s)-d;return s*0**d or s[:n]+s[-t%d-d:]+s[n:-t%d-d]

Receives input as a list, where the last element is the top of the stack.
Uses the 0ⁿ trick to filter zero-depth and python's sign-adjusting modulo operator to determine the part of the list to-be-chopped.

Why not just take f(s,t,d)?

@Cole Thanks for the unpacking! However, I can't see what did you mean by f(s,t,d) (input is the whole stack).

awesome idea for unpacking, though I don't think you should credit me for that (I was suggesting just to take the variables separately). The input spec seems to let you take the depth and turns as separate variables from the stack: "Input and output may be in a list, array, string with a delimiter, passed in one element at a time, or any other reasonable format. Output must be in the same format as the input."

You can save 1 byte with r=-t%d-d. Also, replacing s*0**d with s*(d<1) maintains byte count but maybe improves readability (not that that's the goal). I didn't know that 0**0==1 in Python though, that's interesting.

@BenFrankel I can't save -t%d-d as a value (as I did before), because when d is 0 this would trigger a division-by-zero exception.

@BenFrankel that would fail for d == abs(t) (try [6, 5, 4, 3, 2, 1, 4, 4] for example)

@Uriel, Yeah, I hadn't tested it properly, it actually fails whenever d divides t.

Python 2, 48 bytes
lambda r:r[2:r[1]+2][r[0]:]+r[2:r[0]]+r[r[1]+2:]

Try it online!

JavaScript ES6, 109 92 bytes
x=>{for(i=x.shift(),i=i>0?i:-i,j=x.shift();i-->0&&j>0;)x=x.splice(j,1).concat(x);return x}

Try it online!
Receives input in the form of an array of integers.
Also has the count to arrow :P
Explanation:
The code uses the shift function to extract the first two elements of the list.
It then gets the absolute value of the first element, which is the number of turns.
Since Javascript is zero indexed, the depth index needs to be decreased by 1.
If the depth index was 0 or 1, nothing should change, but due to the decrease, index of 0 would cause changes. Therefore exit the loop if depth index is not <=0.
The splice(a,b) function returns the sub-array of length b with starting index a from the array and leaves the original array without those elements.
When concatenated with the remainder of the original array, this is a single rotation of the array at the depth index.
By performing this operation n times, where n is the number of turns, the resulting array is the result of the roll operator.

TI-Basic, 141 150 bytes (noncompeting)
Prompt L1
L1(1→T
L1(2→D
seq(L1(C),C,3,dim(L1→L1
If TD>0
Then
For(A,1,T
L1(1→B
For(C,2,D
L1(C→L1(C–1
End
B→L1(D
End
End
If TD<0
Then
For(A,1,-T
L1(D→B
For(C,D,2,-1
L1(C–1→L1(C
End
B→L1(1
End
End
L1

Edit: fixed case where depth is zero (+9 bytes)
TI-Basic doesn't support 0-length lists, so this approach won't work for a two-length input.
Explanation:
Prompt L1                # 4 bytes, input list
L1(1→T                   # 7 bytes, turns
L1(2→D                   # 7 bytes, depth
seq(L1(C),C,3,dim(L1→L1   # 18 bytes, remove turns and depth from list
If TD>0                  # 6 bytes, if turns is positive and depth is nonzero (can't be negative)
Then                     # 2 bytes
For(A,1,T                # 7 bytes, do this 'turns' times
L1(1→B                    # 7 bytes, backup the first item
For(C,2,D                # 7 bytes, shuffle the rest along
L1(C→L1(C–1               # 12 bytes
End                      # 2 bytes
B→L1(D                   # 7 bytes, restore the backup to where it should be
End                      # 2 bytes
End                      # 2 bytes
If TD<0                  # 6 bytes, if T is negative and D is nonzero
Then                     # 2 bytes
For(A,1,-T               # 8 bytes, do this -'turns' times
L1(D→B                   # 7 bytes, backup the Dth item
For(C,D,2,-1             # 10 bytes, shuffle the items the other way
L1(C–1→L1(C              # 12 bytes
End                      # 2 bytes
B→L1(1                   # 7 bytes, restore backup to where it belongs
End                      # 2 bytes
End                      # 2 bytes
L1                       # 2 bytes, implicitly return

I think you need code to deal with the 2-element list case, too; currently it will error at the seq(.

Batch, 163 bytes
@set s=
@set r=
@set/ad=%2,t=(%1%%d+d)%%d
:l
@shift
@set/af=t-=1,f^^=d-=1
@if %f% lss 0 (set r=%r% %2)else set s=%s% %2
@if not "%3"=="" goto l
@echo%r%%s%

Takes input as command-line parameters and outputs a space-separated list. The parameters between t and d are extracted into the r variable so that they can be prepended to the s variable, which receives all of the other parameters.