text:
Solve a Single Player Tron Game
Solve a Tron Game
Tron is a great game, and if you haven't played it the internet has MANY online versions available.
A fun challenge is to try to write an AI that plays Tron, which is normally much better than any human, thanks to their frame perfect dodging.
Even with their perfect dodging of walls, they still get themselves trapped easily.
Your task, is to write a script that when fed a map containing a single tron bike, that may already be partially filled, and output the actions required to fill it as much as possible.
The Task
From the letter p in the input, find the best moves to fill the most space in the maze, in as few iterations as possible, then output as a string of r(ight)u(p)l(eft)d(own), describing that path.
If you attempt to move into wall, your run is ended.
if you attempt to move where you have already been, your run is ended.
if your run contains an unexpected character, it is ended at that character.
Filling space refers to passing over it in your run. Your starting position is counted.
Input / Output
Your input will be through any valid method,
A maze, consisting of the characters # p (Pounds (0x23), Literal space (0x20) and the letter p lowercase (0x70))
one of the following forms

A single multiline string
An array of strings, split by lines
An array of arrays, each containing a single character

You must output exactly

A string or array of strings containing only the characters rlud case sensitive, describing your path through the maze.

You may use any reasonable permutation of these input and output format as well, such as bytes instead of characters.
Test Cases
Straight Forward.
Input:
#######
#p    #
#######

Example Output: rrrr
A Turn.
Input:
#######
#p    #
##### #
    # #
    ###

Example Output: rrrrdd
Box Filling.
Input:
#######
#p    #
#     #
#     #
#######

Example Output: rrrrdlllldrrrr
Complicated
Input:
#######
#p    #
#     #
#     #
##### #
    ###

Unfillable
Input:
 ########
 #p     #
 #     ##
###### #
#      #
##     #
 #######

Scoring
Your score is a combination of how fast your code runs and how many squares you fill of all the test cases.
Score is Total successful moves across Test Cases / Algorithmic Complexity Across Test Cases
So if your Algorithm has a complexity of O(a*b) Where 'a' is Maze Width and 'b' is Maze Height, then your Algorithm Complexity Total is (TestCase1Width * TestCase1Height) + (TestCase2Width * TestCase2Height)...
See More on Big O Notation
Highest score Wins!
Notes

The input will always be an enclosed surrounding the p
There will always be atleast 1 space to move from the start
The area may not always be possible to fill completely.
Your code should still work competitively on a random valid input. That is, do not cater just to the test cases.
Standard Loopholes Apply
this is a fastest-algorithm mutation, where both speed and space filled matters, not code length. Go ham.
I'm particularly interested in a Java solution.
Have fun!

Solution tester

var storedMap = "";
 function restoreMap(){
  document.getElementById("maze").value = storedMap;
 }
 function trymaze(){
  var score = "";
  var maze = document.getElementById("maze");
  storedMap = maze.value;
  var commands = document.getElementById("methodin");
  var converts = {r:{r:"─",u:"┌",d:"└",l:"─"},u:{r:"┘",u:"│",d:"│",l:"└"},d:{r:"┐",u:"│",d:"│",l:"┌"},l:{r:"─",u:"┐",d:"┘",l:"─"}}
  var dirs={l:{x:-1,y:0},u:{x:0,y:-1},r:{x:1,y:0},d:{x:0,y:1}};
  var last = "";
  var boxes = commands.value.replace(/./g, function(c){
   if(last==""){
    last = c;
    return {r:"╶",u:"╵",d:"╷",l:"╴"}[c];
   }
   var s = converts[c][last];
   last = c;
   return s;
  })
  var mMaze = maze.value.replace("p"," ").split("\n");
  var pp = maze.value.indexOf("p")
  var y = (maze.value.substring(1,pp).match(/\n/g)||[]).length;
  var x = ((maze.value.match(/.*p/)||[""])[0].length)-1;
  var path = commands.value.split("");
  for(s in path){
   tx = x + dirs[path[s]].x;
   ty = y + dirs[path[s]].y;
   mMaze[y] = mMaze[y].replaceAt(x, boxes[s]);
   if(!mMaze[ty]){
    alert("NO MAZE SEGMENT "+ty);
    break;
   }
   if(mMaze[ty].substring(tx,tx+1)!=" "){
    alert("HIT A WALL: "+tx+" "+ty+" \""+mMaze[ty].substring(tx,tx+1)+"\"")
    break;
   }
   score++;
   x=tx;
   y=ty;
   mMaze[y] = mMaze[y].replaceAt(x, "O");
  }
  if(document.getElementById("score").value){
   document.getElementById("score").value = document.getElementById("score").value + ", " + score;
  }else{
   document.getElementById("score").value = score;
  }
  maze.value = mMaze.join("\n");
 }

 String.prototype.replaceAt=function(index, character) {
     return this.substr(0, index) + character + this.substr(index+character.length);
 }
*{
  font-family: monospace;
 }
 textarea{
  width:30em;
  height:15em;
 }
<textarea id = "maze"></textarea>
 <form>
   <input type="text" id="methodin"></input>
   <input type="button" onclick="trymaze()" value="Try Maze"></input>
   <input type="button" onclick="restoreMap()" value="Reset Maze"></input><br/>
   <input type="text" id="score"></input>
 </form>

What do you mean by an iteration? If you mean a move, the space filled will be equal to the number of moves plus 1. The best way to solve this problem would be to do a huge recursive search of all possible paths before making any moves - does that count as "iterations" or not? At the other end of the scale is a dumb solution that just walks forward until it crashes into a wall without even checking. In the middle, are many other possibilities of movement and level of checking the environment as to what counts as an "iteration" and what doesn´t. The scoring needs more definition.

Should have explained it a bit better.

Can the maze have interior holes?

For reference, this is asking for a known-start Hamiltonian path on a grid graph. It's known that Ham cycle on a general grid graph is NP-complete, whereas for ones without internal holes, a polynomial time algorithm exists. These both likely convert to paths and fixed-start. It's not clear if this is asking for unfillable graphs to be maximally filled, in which case I suspect it's NP-hard in both cases.

Holes are possible, and the idea isn't to find the perfect solution, however, to find a balance between efficiency and space filling.

The thing I most remember about the Tron arcade game: on level 8 light-cycles, if you just hold the joystick to the right, never press the acceleration trigger, and shut your eyes, the three enemy cycles all destroy themselves around you.

@ATaco You should define the exact scoring: "A balance between speed and code space filled" is too vague.


text:
Create another empty string in .NET?
I apologize if this isn't fit for this site but it is a puzzle, not all that practical, so I thought it would fit.
Take this code:
string s = "";
Console.WriteLine(ReferenceEquals(s, string.Empty));

This will print out true because "" is interned by the JITter at some early point and literals are reused from the interning cache.
The question and puzzle is this:

How can you initialize s such that
  1. s.Length == 0
  2. ReferenceEquals(s, string.Empty) == false

I've tried the following:
string s = "test".Substring(0, 0); // any arbitrary legal start offset tried
string s = new string(' ', 0);
string s = new string(new char[0]);
string s = CallSomeMethodThatWontBeInlined() + CallSomeMethodThatWontBeInlined();

These three all end up being equal to string.Empty.
Bonus if you can explain the above behavior with regards to new string(...). I have my thoughts about it but no solid evidence one way or another.
I can understand that all methods that concatenate or take substrings of existing strings special-case the result that will end up with length zero, but how new string(...) actually doesn't create a new object I don't know.
Note! I'm asking for legal C#. I'm not asking for a p/invoke or assembly code call that just manually constructs the bytes of an empty string object in memory and stuffs a pointer to it into a string variable.
Any method or path through existing classes in .NET or using operators of strings or whatnot that would end up with the required results are legal. As such, take the Substring example above, if that returned a new empty string that isn't the same as the existing one, then that would be a/the answer to this puzzle.
Reflection is boundary, at the very least it has to be reflection that can run in untrusted scenarios.

My own "conclusion" is that this may indeed be impossible because the actual C# code that would end up constructing such a string would end up with one of the new string(...) overloads, or using one of the operators which all seem to handle this cases. As such, the end-point of any such code may be the one that handles this case and since it does, it may not be possible.

I guess without some IL this might be impossible. You should also say drop the legal .NET code, because IL is .NET. Otherwise I'd use C++/CLI or any other .NET language. If you only want C#, say C#

OK, I dropped the bit about .NET.

For your own research, you can try to disassemble the .NET library and look at the source of the string class.

.NET is now largely open sourced on github, the string C# source is here - https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/String.cs - and the native methods are here - https://github.com/dotnet/coreclr/blob/master/src/classlibnative/bcltype/stringnative.cpp - but most of the native code is greek to me :)

In my opinion if you disallow reflection as well you're pretty much asking people to find a bug.

If this is indeed supposed to not be possible, then yes, but I'm not convinced that is the only way.

So, I'll take the easy way:
string s = "";

So, s.Length is now 0, so far so good. But how can we get ReferenceEquals(s, string.Empty) to false.
Piece of cake, just put that into your class:
public static new bool ReferenceEquals(object a, object b) => false;

and the above call will result in false.
I will look for some more sneaky methods, so.

Devious circumvention, yes :)

This violates the most highly upvoted "loophole that is forbidden by default".

1st try: Reflection
String s = "abc";
PropertyInfo pi = s.GetType().GetProperty("Length");
pi.SetValue(s, 0, null);

Yields error, there is no set property
Loophole
var s = new { Length = 0 };

Now the ReferenceEquals will return false and s.Length == 0. Just sticking to your rules =)

Another devious circumvention :)

The question asked how to initialise s, but it didn't say that you could also change the type of s. This is either answering a completely different question or interpreting the challenge too literally, which is against the site rules.

After many years of learning:
You need to access m_stringLength by
var fi = s.GetType().GetField("m_stringLength", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
now you can set the internal m_stringLength to 0 by using
fi.SetValue(s, 0);
now s.Length is equal to 0 and object.ReferenceEquals(s, string.Empty) is false

source: Stack Exchange

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

sort: votes


text:
Find the "unwrapped size" of a list
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.
If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.
Test Cases:
[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4

This is code-golf, so the shortest program (in bytes) wins.

Can input be taken as a string, i.e. with enclosing quote marks? Can we use () instead of []?

can we take input in this format [[[]][]] instead of this [[[]],[]] in your second example?

What is the size of ["This is some text [with square brackets in] ...[& maybe more than one pair]"]?

@JonathanAllan I'm pretty sure that the input won't contain any non-list types (at least that's what the definition and the test cases suggest and what pretty much every answer so far assumes).

@JonathanAllan u is not defined for values which aren't a list.

Possible duplicate of Find the occurrences of a character in an input string

@DrMcMoylex I disagree. While counting the number of ] does seem to be the shortest solution in many languages, there are also a lot of answers that actually solve this challenge via list manipulation, and at least in esolangs counting the occurrences of a fixed character is also quite different from counting the occurrences of an input character.

Some answers to this challenge seem to take for granted that input can be given as a string (e.g. "[ ]") and subsequently counts the number of right or left brackets. Are those answers really valid given the specification of the challenge? Given that your language supports some type of list, shouldn't input be a "list-object" rather than just a string?

Retina, 1 byte
]

Try it online! (The first line enables a linefeed-separated test suite.)
By default, Retina counts the number of matches of the given regex in the input. The unwrapped size is simply equal to the number of [] pairs in the input and therefore to the number of ].

Thre right tool for the job!

@MartinEnder do you ever add new functions to your language in order to  save bytes in a codegolf question?

@lois6b not retroactively, but I do occasionally improve the language to make it more powerful for future uses. That said, this answer would have worked in the very first version of Retina from back when it was simply a way to run a single regex (/substitution) against the input without syntactic overhead.

Mathematica, 9 bytes
LeafCount

Turns out there's a built-in for that...
Note that this wouldn't work if the lists actually contained non-list elements. What LeafCount really does is count the number of atomic subexpressions. For input {{}, {{}}}, the expression actually reads:
List[List[], List[List[]]]

Here the atomic subexpressions are actually the heads List.

Mathematica has a built-in for everything...

@Challenger5 Oy, plagiarism. :P

Brainfuck, 71 61 59 bytes
+[>,]<[>-[<->---]+<------[->[-]<]>[-<+>]<[-<[<]<+>>[>]]<]<.

Takes input from STDIN in the format given in the question, and outputs the character whose ASCII code is the list's "unwrapped size."
I'm still a complete amateur at Brainfuck, so there are most likely many optimizations that can still be made.
Try it online!
Ungolfed:
read input to tape
>>+[>,]<
current tape: (0 0 1 a b *c)
where abc represents input and * is IP

now we loop over each character (from the end)
this loops assumes we are starting on the (current) last char
and it zeroes the entire string by the time it finishes
[

  subtract 91 from this character
  technically we only subtract 85 here and correct the answer
  with the 6 minus signs below
  >-[<->---]
  current tape: (0 0 1 a b cminus91 *0)

  invert the result and put that in the next cell
  +<------[->[-]<]>
  current tape: (0 0 1 a b 0 *c==91)

  move that result back to the original cell
  [-<+>]<
  current tape: (0 0 1 a b *c==91)

  if the result is true we found a brace
  increment the very first cell if so
  [-<[<]<+>>[>]]<
  current tape: (count 0 1 a *b)

]
current tape: (count *0)

<.

JavaScript (ES6), 29 27 bytes
f=([x,...a])=>x?f(x)+f(a):1

i love it when a recursion turns out this cleanly. This is basically a depth-first search of the input, adding 1 whenever the end of an array is reached.
If an empty array were falsy in JS, this could be 24 bytes:
f=a=>a?f(a.pop())+f(a):1

But alas, it's not. Other attempts:
f=a=>a.reduce((n,x)=>n+f(x),1) // Works, but 3 bytes longer
f=a=>a.map(x=>n+=f(x),n=1)&&n  // Works, but 2 bytes longer
f=a=>(x=a.pop())?f(x)+f(a):1   // Works, but 1 byte longer
f=a=>a[0]?f(a.pop())+f(a):1    // Works, but same byte count
f=a=>a+a?f(a.pop())+f(a):1     // Doesn't work on any array containing 1 sub-array
f=a=>a-1?f(a.pop())+f(a):1     // Same

Would f=a=>a[0]?f(a.pop())+f(a):1 work? (Same byte count though.)

@Neil Yes, that's one of the solutions I've already tried. I don't think it's possible to get any shorter...

(By the way, I would have gone for the extravagant f=a=>a.reduce((n,a)=>n+f(a),1). Now, f=(n,a)=>n+a.reduce(f,1) is only 24 bytes, but sadly the parameters are in the wrong order.)

@Neil I actually did that first, except shortening it by 1 byte: f=a=>a.map(a=>n+=f(a),n=1)&&n

Ah, sorry, I hadn't thought to browse the edit history.

Perl, 9 8 7 + 1 = 8 bytes
Requires the -p flag
$_=y;[;

Thanks to @Dada for two byte saves (I'm loving this semicolon exploit btw)

-p to save 1 byte ;)

You can use y;[; to save one more byte

CJam, 7 5 bytes
Thanks to Peter Taylor for removing 2 bytes! (e= instead of f=:+)
r'[e=

Try it online!
r         e# Read input
 '[       e# Push open bracket char
   e=     e# Count occurrences. Implicit display

Python 3 2, 36 23 bytes
lambda x:`x`.count("[")

I noticed that u(l) is equal to the number of [ in the string representation of l, so this program tries to do that. It could probably be golfed further by finding another way to do this, though...

23 bytes: lambda x:`x`.count("[")

05AB1E, 4 bytes
I'[¢

I    Get input as a string
 '[¢ Count the opening square brackets and implicitly print them

Try it online!
I think it can be golfed more but that 'I' is mandatory, otherwise the input is considered an actual array instead of a string

"[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]]" in the input removes that I requirement, though I don't know if that is allowed.

@carusocomputing: It's not currently allowed, but that could change (I see Luis asking the OP that same question)

Dang, 14 hours before me.

Ruby, 13 (+1) bytes
p $_.count ?[

Called with -n argument:
ruby -ne 'p $_.count ?['

EDIT: Changed to actually print out the answer

This doesn't seem to print anything. (Unless this is a REPL answer, in which case the language should be specified as Ruby REPL.)

@Martin Ender♦  The specification allowed for returning the value instead of printing it.

That refers to function submissions. E.g. ->s{s.count ?[} would be a valid submission.

Is that a general rule?

See this post for admissible I/O methods.

Labyrinth, 8 bytes
&-
#,(/!

Try it online!
Explanation
This counts the opening brackets via a bit of bitwise magic. If we consider the results of the character codes of the bitwise AND of [, , and ] with 2, we get:
[ , ]
2 0 0

So if we just sum up the result of this operation for each character, we get twice the value we want.
As for the code itself, the 2x2 block at the beginning is a small loop. On the first iteration &- don't really do anything except that they put an explicit zero on top of the implicit ones at the bottom of the stack. This will be the running total (and it will actually be negative to save a byte later). Then the loop goes as follows:
,   Read character. At EOF this gives -1 which causes the instruction pointer to
    leave the loop. Otherwise, the loop continues.
#   Push the stack depth, 2.
&   Bitwise AND.
-   Subtract from running total.

Once we leave the loop, the following linear bit is executed:
(   Decrement to turn the -1 into a -2.
/   Divide negative running total by -2 to get desired result.
!   Print.

The IP then hits a dead and turns around. When it tries to executed / again, the program terminates due to the attempted division by zero.

Python, 26 bytes
f=lambda a:sum(map(f,a))+1

Simple recursive formula.

Brain-Flak, 63, 61 bytes
{({}[(((()()()){}){}()){({}[()])}{}]){{}(<>{}())(<>)}{}}<>

Try it online!
58 bytes of code, and +3 for the -a flag enabling ASCII input.
Readable version/explanation:
#While non-empty:
{

    #subtract
    ({}[

    #91
    (((()()()){}){}()){({}[()])}{}

    ])

    #if non-zero
    {

        # Remove the difference
        {}

        #Increment the counter on the other stack
        (<>{}())

        #Push a zero onto the main stack
        (<>)
    }

    #pop the left-over zero
    {}

#endwhile
}

#Move back to the stack with the counter, implicitly display
<>

Jelly, 4 bytes
ß€S‘

Doesn't use string manipulation. Try it online! or verify all test cases.
How it works
ß€S‘  Main link. Argument: A (array)

ß€    Map the main link over A.
  S   Sum. For empty arrays, this yields zero.
   ‘  Increment.

C#, 46 41 bytes
int u(string l){return l.Count(c=>c=='[');}

l is the string of nested list. Test it here.

Use the 4 spaces (before the code) for formatting it into a code block

@KritixiLithos oops, I forgot to correctly do that. Thanks for pointing it out :)

And this has to be a program or a function, this is neither.

@KritixiLithos oops, thanks for pointing it out, just fixed it.

You can drop the curly braces and return by using an expression bodied function. Also char implicitly casts to int so you can use 91 instead of '[': int u(string l)=>l.Count(c=>c==91); Further, you could drop the function signature and use a lambda method: l=>l.Count(c=>c==91);.

This uses linq so should include using System.Linq in the byte count, You might be able to do c<92 to save 1 byte but I haven't tried that

Befunge, 22 18 16 bytes
~:0#@`#.!#$_3%!+

TryItOnline!
Edit: Thanks to Martin Ender for shaving off 4 bytes!
Edit2: Credit to David Holderness for optimizing out two more

Regex, 1 byte
]

Try it online!

I'm not sure Regex is a programming language, but even if it is, there's already an identical Retina answer.

tinylisp repl, 39 bytes
(d u(q((L)(i L(s(u(h L))(s 0(u(t L))))1

Defines a function u that can be called like (u (q ((())()) )) (for the second test case). Doing it in the repl saves 4 bytes due to auto-closed parentheses.
Explanation
(d u                                      )  Define u as
    (q                                   )    the following, unevaluated
      (                                 )     list (which acts as a function in tinylisp):
       (L)                                   Given arglist of one element, L, return:
          (i L                         )     If L (is nonempty):
              (s(u(h L))             )        Call u on head of L and subtract
                        (s 0        )          0 minus
                            (u(t L))           call u on tail of L
                                      1      Else, 1

The x-(0-y) construct is necessary because tinylisp doesn't have a built-in addition function, only subtraction.

///, 13 bytes
/[/0//]///,//

Output in unary.
Try it online!
Explanation:
/[/0/          Replace every [ with 0
     /]///,//  Remove every ] and ,

How do you pronounce /// ?

@ropata Slashes

PHP, 35 bytes
<?=preg_match_all('/\[/',$argv[1]);

preg_match_all finds all of the matching instances of the regular expression and returns a number, which is why the short echo tags are needed.
Like most answers, it counts the number of [ in the input and outputs that number

If you use ] instead of [, you won't have to escape it.

count_chars()[91]; does much the same thing but is shorter.

Racket 82 bytes
(define n 0)(let p((l l))(if(null? l)(set! n(+ 1 n))(begin(p(car l))(p(cdr l)))))n

Ungolfed:
(define (f l)
  (define n 0)
  (let loop ((l l))
    (if (null? l)
        (set! n (add1 n))
        (begin (loop (first l))
               (loop (rest l)))))
  n)

Testing:
(f '[])
(f '[[[]] []])
(f '[[[]] [[[[]] []]] [[[]] [[[[]] [[] [[]]]]]]])
(f '[[[[]]]])

Output:
1
4
19
4

C, 48 46 Bytes
Saved two bytes thanks to kirbyfan64sos
i;f(char*v){for(i=0;*v;i+=*v++==91);return i;}

i;f(char*v){for(i=0;*v;*v++^91?0:i++);return i;}

Test code
main()
{
    printf("%d\n", f("[]"));
    printf("%d\n", f("[[[]] []]"));
    printf("%d\n", f("[[[]] [[[[]] []]] [[[]] [[[[]] [[] [[]]]]]]]"));
}

Test cases
a.exe
1
4
19

Change *v++^91?0:i++ to i+=*v==91 to save 3 bytes.

@kirbyfan64sos Thanks!  I still need to increment v but I can use i+=*v++==91 to save two bytes.

V, 10 bytes
ÓÛ
ÒC0@"

Try it online!
This contains some unprintable characters, here is the readable version:
ÓÛ
Ò<C-a>C0<esc>@"

<C-a> represents "ctrl-a" (ASCII 0x01) and <esc> represents the escape key (ASCII 0x1b).
ÓÛ              " Remove all '['s
                "
Ò<C-a>          " Replace what's left with '<C-a>' (the increment command)
      C         " Delete this line
       0<esc>   " And replace it with a '0'
             @" " Run what we just deleted as V code (A bunch of increment commands

More fun, less golfy version:
o0kòf]m`jòd

Try it online!
o0<esc>                     " Put a '0' on the line below us
       k                    " Move back up a line
        ò               ò   " Recursively:
         f]                 "   Move to a right-bracket
           m`               "   Add this location to our jumplist
             j              "   Move down a line
              <C-a>         "   Increment this number
                   <C-o>    "   Move to the previous location
                         d  " Delete the bracket line
                            " Implicitly display

Brainfuck, 28 bytes
,
[
  -
  [
    -
    [
      >+<-
      [->]
    ]
    >[>>]
    <<<
  ]
  ,
]
>.

Try it online.
This counts the number of input characters divisible by 3, i.e. the number of ] characters.
Alternate 34-byte solution counting [ characters directly and relying on 8-bit cells:
,
[
  <-[>-<---]
  >------
  [>-<[-]]
  >+<,
]
>.

Scala, 15 bytes
s=>s.count(92<)

Ungolfed:
s=>s.count(c=>92<c)

count counts how many elements satisfy a predicate, in this case 92<, which is the method < of 92.

><>, 21 20 18 bytes
0i:0(90.;n?|3%0=+!

Edit: score 1 for goto statements!
Edit 2: Apparently ><> differs from Befunge in that it allows non-zero IP offset after wrapping (in other words, by using a trampoline instruction, I can wrap to (1, 0) instead of (0, 0)). Interesting.
TryItOnline!

Haskell, 20 19 17 bytes
f s=sum[1|']'<-s]

Try it online!
Takes the list as string and puts a 1 in a list for each ], then sums up all the 1s.

Pointfree version: (19 bytes)
length.filter(>'[')

Assumes , [ ] are the only chars in the string. Filters the list to get all chars greater than [, which are all ] and returns the length.
Usage:
Prelude> length.filter(=='[')$"[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]]"
19

Befunge-98, 12 11 10 9 bytes
~3%!+2j@.

TryItOnline!
Edit: Thanks to Martin Ender for shaving off a byte

O, 15 bytes
i~{1\{nJ+}d}J;J

Try it here!
In the input, any commas must be either removed or replaced by spaces.
Explanation
i~{1\{nJ+}d}J;J
i                Read a line of input.
 ~               Evaluate it.
  {        }J;   Define a function and save it into the `J` variable.
                 Currently, the input array is at the top of the stack.
   1\            Push 1 and swap it with the input array.
     {   }d      For each element in the array...
                 Because the array was popped by `d`, 1 is at the TOS.
      nJ+        Recurse and add the result to 1.
              J  Initiate the function call.
                 The result is printed implicitly.

If we're allowed to take work on a string: 10 bytes
ie\']-e@-p

Prolog (SWI), 43 bytes
u(L,N):-L=[H|T],u(H,A),u(T,B),N is A+B;N=1.

Defines a predicate u that takes a list as its first argument and unifies its second argument with the unwrapped size of that list. Verify all test cases on Ideone.
Explanation
First, L=[H|T] tries to unify L with a list of the structure "one item H, followed by the rest of the list T."

If the list is nonempty, the unification succeeds. We then run u recursively on H and T, getting the results in A and B. Finally, we add these two and assign the result to N.
If the unification fails, we have an empty list, in which case we need only unify N with 1.

Bash + coreutils, 29 bytes
f()(echo $1|tr -d -c [|wc -c)

You can remove most of this and just do tr -d -c [|wc -c, which will by default read the list from standard input.

DASH, 14 bytes
(ss[len;!> ="]

Simply counts ]'s. Usage:
(ss[len;!> ="]"])"[[]]"

Bonus solution, 15 bytes
a\@+1sum ->#a#0

This one recursively counts from a real list. Usage:
(f\@+1sum ->#f#0)[[]]

Java 7, 48 bytes
int c(String l){return l.split("\\[").length-1;}

If we aren't allowed to use a String as input, then we have the following instead (60 bytes - Try it here):
int c(java.util.List l){return(l+"").split("\\[").length-1;}

Ungolfed & test cases:
Try it here.
class M{
    static int c(String l){
        return l.split("\\[").length - 1;
    }

    public static void main(String[]a){
        System.out.println(c("[]"));
        System.out.println(c("[[[]],[]]"));
        System.out.println(c("[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]]"));
        System.out.println(c("[[[[]]]]"));
    }
}

Output:
1
4
19
4

Clojure, 42 bytes
Does not leave much room for tweaking as the syntax is so limited. Basically just follows the definition.
(fn[i](if(empty? i)1(apply + 1(map f i))))

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


text:
Find the rate of change at a point on a polynomial
Given the equation of a polynomial and an x-coordinate find the rate of change of the point at that x-coord on the curve.
A polynomial is in the form: axn + axn-1 + ... + ax1 + a, where a ϵ Q and n ϵ W. For this challenge, n can also be 0 if you don't want to have to deal with special cases (constants) where there is no x.
To find the rate of change at that x-coord, we can get the derivative of the polynomial and plug in the x-coord.
Input
The polynomial can be taken in any reasonable form, but you must state what that format is explicitly. For example, an array of the form [..[coefficient, exponent]..] is acceptable.
Output
The rate of change of the point at the x-coord given.
This is code-golf, so shortest code in bytes wins.
Examples
[[4, 3], [-2, 4], [5, 10]]   19    ->   16134384838410
                  [[0, 4]]  400    ->   0
           [[4, 0], [5,1]]  -13    ->   5
      [[4.14, 4], [48, 2]]   -3    ->   -735.12
         [[1, 3], [-5, 0]]    5.4  ->   87.48

Algorithm for anyone who doesn't have the appropriate math background:
The derivative of Ax^B+Cx^D+... is (A*B)x^(B-1)+(CD)*x^(D-1)+...

I'm not familiar with the set W. Is that the natural numbers union 0?

@AlexA., yes, it is.

Borderline dupe

@PeterTaylor I think they share a similar idea but I don't think any answer from there could be posted here without very, very significant modification.

Mathematica, 6 bytes
#'@#2&

(Beat THAT, MATL and 05AB1E)
The first argument must be a polynomial, with # as its variable and with & at the end (i.e. a pure function polynomial; e.g. 3 #^2 + # - 7 &). The second argument is the x-coordinate of the point of interest.
Explanation
#'

Take the derivative of the first argument (1 is implied).
... @#2&

Plug in the second argument.
Usage
#'@#2&[4 #^3 - 2 #^4 + 5 #^10 &, 19] (* The first test case *)

16134384838410

You win by 0 bytes now :-P

@LuisMendo When a guy with a chef's knife can tie with a mandoline in a slicing competition, I'll give the point to the guy using the knife. ;)

MATL, 8 6 bytes
yq^**s

Input is: array of exponents, number, array of coefficients.
Try it online! Or verify all test cases: 1, 2 3, 4, 5.
Explanation
Consider example inputs [3 4 10], 19, [4 -2 5].
y    % Take first two inputs implicitly and duplicate the first
     %   STACK: [3 4 10], 19, [3 4 10]
q    % Subtract 1, element-wise
     %   STACK: [3 4 10], 19, [2 3 9]
^    % Power, element-wise
     %   STACK: [3 4 10], [361 6859 322687697779]
*    % Multiply, element-wise
     %   STACK: [1083 27436 3226876977790]
*    % Take third input implicitly and multiply element-wise
     %   STACK: [4332 -54872 16134384888950]
s    % Sum of array
     %   STACK: 16134384838410

Julia, 45 42 40 37 bytes
f(p,x)=sum(i->prod(i)x^abs(i[2]-1),p)

This is a function that acceps a vector of tuples and a number and returns a number. The absolute value is to ensure that the exponent isn't negative, which necessary because Julia annoying throws a DomainError when raising an integer to a negative exponent.
Try it online! (includes all test cases)
Thanks to Glen O for a couple of corrections and bytes.

I feared that @AlexA. and Julia broke up, but here they are again, together in harmony <3

You can save an extra three bytes if, instead of using i[2]>0&& to deal with the constant case, you use abs(i[2]-1) in the exponent of x. And a slightly less clean trick to save another three bytes is to use p%x instead of f(p,x) - note that you can call it as %(p,x) if you want to use it in function form... unfortunately, it seems it doesn't work on TIO (which apparently is running Julia 0.4.6), although it works on my Julia 0.5.0.

@GlenO Nice, thanks for the suggestions. I went with the abs part, but redefining infix operators physically pains me...

05AB1E, 12 11 bytes
Saved one byte thanks to Adnan.
vy¤<²smsP*O

v          For each [coefficient, power] in the input array
 y         Push [coefficient, power]
  ¤<       Compute (power-1)
   ²       Push x value (second input entry)
    sms    Push pow(x, power-1)
       P   Push coefficient * power ( = coefficient of derivative)
        *  Push coefficient * power * pow(x, power-1)
         O Sum everything and implicitly display the result

Try it online!
Floating point precision is Python's. I currently swap stack values twice, maybe there is a way to avoid it and save some bytes.

I believe you can leave out the } :).

DIs<m**O is 8 bytes, following the MATL answer that @Luis Mendo provided.

Even better, s¹<m**O is 7 bytes. (http://05ab1e.tryitonline.net/#code=c8K5PG0qKk8&input=WzMsNCwxMF0KMTkKWzQsLTIsNV0)

It changes substantially the input format while I kept the original one. But I agree that manipulating the input format enables shorter answers.

@Osable true, but others have used that loophole ;)

Python 3, 41 bytes
6 bytes removed thanks to @AndrasDeak! In fact, this answer is now more his than mine...
Thanks also to @1Darco1 for two corrections!
lambda A,x:sum(a*b*x**(b-1) for a,b in A)

Anonymous function that accepts a list of lists with coefficients and exponents (same format as described in the challenge) and a number.
Try it here.

Why can you sum a*x**(b-1) instead of a*b*x**(b-1) ? And further, what if $x=0$ ?

@1Darco1 You are right on both. I'll change it in a little while

R, 31 bytes
function(a,n,x)sum(a*n*x^(n-1))

Anonymous function that takes a vector of coefficients a, a vector of exponents n, and an x value.

Nice! I added another answer with the same byte count. It uses a completely different approach though. Isn't R amazing?

Edit: No longer the same byte count :)

MATLAB with Symbolic Math Toolbox, 26 bytes
@(p,x)subs(diff(sym(p)),x)

This defines an anonymous function. Inputs are:

a string p defining the polynomial, in the format '4*x^3-2*x^4+5*x^10'
a number x

Example use:
>> f = @(p,x)subs(diff(sym(p)),x)
f =
    @(p,x)subs(diff(sym(p)),x)

>> f('4*x^3-2*x^4+5*x^10', 19)
ans =
16134384838410

You could use @(x,p)polyval(polyder(p),x) in order to gain a byte.

@flawr Well, he shouldn't now because you just posted that as an answer ;P

@flawr Thanks, but that's too different, you should post it!

Well I think you wouldn't have done it anyway, 'cause you'd gain a byte =D

@flawr Aww. I completely misunderstood, haha

Matlab, 27 bytes
This is an anonymous function that accepts a value x and a polyonmial p in the form of a list of coefficients, e.g. x^2 + 2 can be represented as [1,0,2].
@(x,p)polyval(polyder(p),x)

JavaScript (ES7), 40 bytes
(a,n)=>a.reduce((t,c,i)=>t+i*c*n**--i,0)

a is an array of the coefficients in ascending exponent order with zeros included e.g. x³-5 would be represented by [-5, 0, 0, 1].

R, 31 27 bytes
Unnamed function taking two inputs p and x. p is assumed to be an R-expression of the polynomial (see example below) and x is simply the point of evaluation.
function(p,x)eval(D(p,"x"))

It works by calling the D which computes the symbolic derivative w.r.t. x and the evaluates the expression at x.
Example output
Assuming that the function is now named f it can be called in the following way:
f(expression(4*x^3-2*x^4+5*x^10),19)
f(expression(0*x^4),400)
f(expression(4*x^0+5*x^1),-13)
f(expression(4.14*x^4+48*x^2),-3)
f(expression(1*x^3-5*x^0),5.4)

which respectively produces:
[1] 1.613438e+13
[1] 0
[1] 5
[1] -735.12
[1] 87.48

Thanks for showing me this! I hadn't considered the possibility of having the input as an expression - this is a really elegant solution.

C++14, 165 138 133 112 110 bytes
Generic Variadic Lambda saves a lot. -2 bytes for #import and deleting the space before <
#import<cmath>
#define A auto
A f(A x){return 0;}A f(A x,A a,A b,A...p){return a*b*std::pow(x,b-1)+f(x,p...);}

Ungolfed:
#include <cmath>

auto f(auto x){return 0;}

auto f(auto x,auto a,auto b,auto...p){
    return a*b*std::pow(x,b-1)+f(x,p...);
}

Usage:
int main() {
 std::cout << f(19,4,3,-2,4,5,10) << std::endl;
 std::cout << f(400,0,4) << std::endl;
 std::cout << f(-13,4,0,5,1) << std::endl;
 std::cout << f(-3,4.14,4,48,2) << std::endl;
 std::cout << f(5.4,1,3,-5,0) << std::endl;
}

You seem to have crossed out all your byte counts. What's the actual byte count, then?

@numbermaniac thank you, done.

PARI/GP, 20 bytes
a(f,n)=subst(f',x,n)

For example, a(4*x^3-2*x^4+5*x^10,19) yields 16134384838410.

How the heck does that work?

@cat It calculates the derivative f' of f, and then substitutes n for x.

dc, 31 bytes
??sx0[snd1-lxr^**ln+z2<r]srlrxp

Usage:
$ dc -e "??sx0[snd1-lxr^**ln+z2<r]srlrxp"
4.14 4 48 2
_3
-735.12

Haskell, 33 bytes
f x=sum.map(\[c,e]->c*e*x**(e-1))

Usage:
> f 5.4 [[1, 3], [-5, 0]]
87.48000000000002

Dyalog APL, 26 25 23 bytes
{a←⍺⋄+/{×/⍵×a*2⌷⍵-1}¨⍵}

Takes polynomial as right argument and value as left argument.

DASH, 33 bytes
@@sum(->@* ^#1- :1#0 1(sS *)#0)#1

Usage:
(
  (
    @@sum(->@* ^#1- :1#0 1(sS *)#0)#1
  ) [[4;3];[_2;4];[5;10]]
) 19

Explanation
@@                             #. Curried 2-arg lambda
                               #. 1st arg -> X, 2nd arg -> Y
  sum                          #. Sum the following list:
    (map @                     #. Map over X
                               #. item list -> [A;B]
      * ^ #1 - :1#0 1(sS *)#0  #. This mess is just A*B*Y^(B-1)
    )#1                        #. X

Scala, 46 bytes
s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum

Usage:
val f:(Seq[(Double,Double)]=>Double=>Double)=
  s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum
print(f(Seq(4.0 → 3, -2.0 → 4, 5.0 → 10))(19))

Explanation:
s=>                        //define an anonymous function with a parameter s returning
  i=>                        //an anonymous function taking a paramater i and returning
    s map{                   //map each element of s:
      case(c,e)=>              //unpack the tuple and call the values c and e
        c*e*math.pow(i,e-1)    //calculate the value of the first derivate
    }sum                      //take the sum

Axiom 31 bytes
h(q,y)==eval(D(q,x),x,y)::Float

results
 -> h(4*x^3-2*x^4+5*x^10, 19)
     161343 84838410.0

 -> h(4.14*x^4+48*x^2, -3)
     - 735.12

Casio Basic, 16 bytes
diff(a,x)|x=b

Input should be the polynomial in terms of x. 13 bytes for the code, +3 bytes to enter a,b as parameters.
Simply derives expression a in respect to x, then subs in x=b.

Pari/GP, 14 bytes
p->x->eval(p')

Usage:
? (p->x->eval(p'))(4*x^3 - 2*x^4 + 5*x^10)(19)
%1 = 16134384838410

Try it online!

Python 2, 39 bytes
lambda p,x:sum(c*e*x**~-e for c,e in p)

lambda function takes two inputs, p and x. p is the polynomial, given in the example format given in the question. x is the x-value at which to find the rate of change.

C, 78 bytes
f(int*Q,int*W,int S,int x){return Q[--S]*W[S]*pow(x,W[S]-1)+(S?f(Q,W,S,x):0);}

Clojure, 53 bytes
#(apply +(for[[c e]%](apply * c e(repeat(dec e)%2))))

The polynomial is expressed as a hash-map, keys being coefficients and values are exponents.

APL(NARS), 6 chars
{⍵⊥⍺}∂

For the input of polynom the list
$$ a_n a_{n-1} ... a_1 a_0  $$
means polynom
$$ a_n X^n+a_{n-1} X^{n-1} ... a_1 X+a_0   $$
      f←{⍵⊥⍺}∂
      5 4 f ¯13
5
      5 0 0 0 0 0 ¯2 4 0 0 0 f 19
1.613438484E13
      0 0 0 0 0 f 400
0
      0 f 400
0
      4.14 0 48 0 0 f ¯3
¯735.12
      1 0 0 ¯5 f 5.4
87.48

for say the true i dont know why the function polynom is build before derivate

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


text:
Write a continuous quine (quine-variant)

Let's define a 2-quine as a program that prints its source code two times. For example, if the program ABC printed ABCABC, it would be a 2-quine.
Let's define a 3-quine as a program that prints its source code three times. For example, if the program ABC printed ABCABCABC, it would be a 3-quine.
Let's define a n-quine as a program that prints its source code n times.

Your task is to write a 2-quine, that prints a 3-quine, that prints a 4-quine, that prints a 5-quine, etc...
For example, here is an example of a valid submission (which is fictional of course):
AB

which prints
ABAB

which prints
ABABABABABAB

which prints
ABABABABABABABABABABABABABABABABABABABABABABABAB

etc.
Remember, this is code-golf, so the program with the fewest bytes wins.

Related. Also related.

You should explicitly forbid programming languages where a 0-byte program is a quine. Otherwise I would say: "QBasic - 0 bytes!"

@MartinRosenau Those are forbidden by default.

I challenge someone to do this in a purely functional language, because I can't figure it out...

Related.

@CamilStaps Just did it in Underload, but that's a bit of a cheat.

@CamilStaps I figured out how to do it in C but I can't because online IDEs for C lock the program's file's attributes up and I can't read them. Anyways, what you do is make sure your program is just 1 line of code and ends with // this way when it repeats itself the repeats are all commented out, that way you don't get errors for defining your main(){} function more than once. Your quine also contains a for loop for printing itself out and the number of times that loops is based on your file size which can be read from the pre-processor __FILE__. So the bigger the file, the more loops

@AlbertRenshaw that's great, but C is not a purely functional language.

@CamilStaps My apologies, misunderstood the definition of purely functional; thanks for the link!

@AlbertRenshaw no problem. And of course, you can add your implementation to the answers here. That it does not work in an online IDE is not a problem as far as I know, especially since most people have a C compiler on their installation already :)

QBasic (224 bytes incl. trailing CR+LF)
(Tested with QBasic/MS-DOS on a virtual machine as well as with FreeBASIC with "-lang qb" setting)
a$="a$=:l=l+1:if l>y then f=f+1:y=y*f+y+f:while x<=y:x=x+1:print mid$(a$,1,3)+chr$(34)+a$+chr$(34)+mid$(a$,4):wend":l=l+1:if l>y then f=f+1:y=y*f+y+f:while x<=y:x=x+1:print mid$(a$,1,3)+chr$(34)+a$+chr$(34)+mid$(a$,4):wend

Nice to see QBasic as the first answer to a question! Check out my QBasic quine for some ideas that might be able to shorten this a good bit. Also, I don't think you need to count the trailing CR+LF.

@DLosc The 2-quine generated must contain CR+LF between the lines. For this reason the CR+LF is definitely a part of the program and I have to count it.

Ah, that makes sense.

Why CR+LF and not LF?

Javascript ES6 (REPL), 52 bytes
var a=a||'';$=_=>a+=`$=${$};$();`.repeat(a?1:2);$();

Initial working implementation, may be golfable.

y.onclick=_=>z.innerText=eval("var a=a||'';$=_=>a+=`$=${$};$();`.repeat(a?1:2);$();".repeat(x.value))
<input id=x><button id=y>Submit!</button>

Explanation
Based on my usual quine implementation ($=_=>`$=${$};$()`;$()).
var a||'' coerces a to an empty string if it isn't defined; otherwise, a is left as is. a will store our final result.
Each function call, a will be checked to see if it is empty/falsy. The first function call will append 2 copies of the quine because a is empty; subsequent calls will only append 1 copy because a is no longer empty.
The last function call will output the final value of a after finishing.

Ruby, 154 bytes

s=DATA.read.lines;s+=s[0,2];n=s.size/4;k=1;n/=k+=1while n>0;puts s*k
__END__
s=DATA.read.lines;s+=s[0,2];n=s.size/4;k=1;n/=k+=1while n>0;puts s*k
__END__

The trailing newline matters.
This program first duplicates itself; the output triplicates itself; that output quadruplicates itself, etc.
Thus the n-th program is a repetition of these 4 lines, n! times.
s=DATA.read.lines;s+=s[0,2]; gets us the current source code as an array of lines. We take its length, divide it by 4, compute the inverse factorial, add one, then print s that many times.

Python 3.8 (pre-release), 117 bytes
for x in 1,0:
 exec(s:="if x%2:a=1;d={}\nx or~input('for x in 1,0:\\n exec(s:=%r)#'%s*~-a*d[a-1]);a+=1;d[x]=a;x*=a")#

Try it online!
How it works :

for x in 1,0: allows me to iterate through the code twice
then I execute some code
# at the end comment the for x in 1,0: if the "base" is repeated multiple times

the code executed :
if x%2: # execute if x=1 (happen only once at the start,
        # after that x will always be a multiple of 2)
    a=1
    d={}

# if x==0: print the quine the right number of time then crash
x or~input('for x in 1,0:\\n exec(s:=%r)#'%s*~-a*d[a-1])

a+=1   # a increments itelf by one for each line of the code
d[x]=a # store (a-1)! and a
x*=a   # x = a!

If the actual code is a n quine, it has (n-1)! times the "base" and should print it n! times:

Because a is incremented by 1 each line, after the first iteration of the for loop, a is equal to (n-1)!+1.
I then search a-1 into d (wich store relation beetween (k-1)! and k) to find n.
I multiply n by a-1 to get n!
I print this number times the "base"


text:
Array unification
Introduction
Consider two arrays of the same length, say A = [0,1,0,2] and B = [-1,1,2,2].
Suppose we know that their contents are equivalent in some sense, item by item:

0 is equivalent to -1,
1 is equivalent to 1,
0 is equivalent to 2, and
2 is equivalent to 2.

Equivalence is transitive: -1 and 0 are equivalent, and 0 and 2 are equivalent, so -1 and 2 are also equivalent.
The unification of A and B is the array where each item of A (or B) has been replaced by the largest number that's equivalent to it.
In this case, the unification would be [2,1,2,2].
The task
Write a program or function that takes two non-empty integer arrays of equal length, and outputs their unification. You can also modify one of the inputs in place instead of returning.
The lowest byte count wins.
Test cases
[0] [0] -> [0]
[1] [2] -> [2]
[0,-1] [-1,-1] -> [0,0]
[0,1,0] [2,1,0] -> [2,1,2]
[1,2,3] [0,0,1] -> [3,3,3]
[0,1,0,2] [-1,1,2,2] -> [2,1,2,2]
[1,0,1,-4] [-3,-1,-2,2] -> [1,0,1,2]
[1,2,3,-2] [1,0,-3,-2] -> [1,2,3,-2]
[-3,-2,-1,0,1] [-1,-1,-1,-1,-1] -> [1,1,1,1,1]
[-3,-2,-1,0,1] [2,-1,0,1,-3] -> [2,2,2,2,2]
[-3,5,5,3,1] [4,2,3,1,2] -> [4,5,5,5,5]
[4,0,2,-5,0] [0,4,-5,3,5] -> [5,5,3,3,5]
[-2,4,-2,3,2,4,1,1] [-2,4,1,2,2,3,1,-2] -> [1,4,1,4,4,4,1,1]
[-10,-20,-11,12,-18,14,-8,-1,-14,15,-17,18,18,-6,3,1,15,-15,-19,-19] [-13,6,-4,3,19,1,-10,-15,-15,11,6,9,-11,18,6,6,-5,-15,7,-11] -> [-8,14,18,14,19,14,-8,-1,-1,15,14,18,18,18,14,14,15,-1,18,18]
[20,15,2,4,-10,-4,-19,15,-5,2,13,-3,-18,-5,-6,0,3,-6,3,-17] [-18,7,6,19,-8,-4,-16,-1,13,-18,8,8,-16,17,-9,14,-2,-12,7,6] -> [20,15,20,19,-8,-4,20,15,17,20,17,17,20,17,-6,14,15,-6,15,20]

I'm not quite sure why you called that operation unification.

@Fatalize I got inspired by type unification.

JavaScript (ES6), 100 90 110 102 96 bytes
a=>b=>a.map(v=>t[v],a.map((_,k)=>a.map((x,i)=>t[x]=t[y=b[i]]=Math.max(k?t[x]:x,k?t[y]:y)),t={}))

My initial solution was 90 bytes:
a=>b=>a.map(v=>t[v],a.map(_=>a.map((x,i)=>t[x]=t[y=b[i]]=Math.max(t[x]||x,t[y]||y)),t={}))

Although it's passing all provided test cases, it fails for something such as:
A = [0, -1], B = [-1, -1]

Test cases

let f =

a=>b=>a.map(v=>t[v],a.map((_,k)=>a.map((x,i)=>t[x]=t[y=b[i]]=Math.max(k?t[x]:x,k?t[y]:y)),t={}))

console.log(JSON.stringify(f([0])([0]))); // -> [0]
console.log(JSON.stringify(f([1])([2]))); // -> [2]
console.log(JSON.stringify(f([0,1,0])([2,1,0]))); // -> [2,1,2]
console.log(JSON.stringify(f([1,2,3])([0,0,1]))); // -> [3,3,3]
console.log(JSON.stringify(f([0,1,0,2])([-1,1,2,2]))); // -> [2,1,2,2]
console.log(JSON.stringify(f([1,0,1,-4])([-3,-1,-2,2]))); // -> [1,0,1,2]
console.log(JSON.stringify(f([1,2,3,-2])([1,0,-3,-2]))); // -> [1,2,3,-2]
console.log(JSON.stringify(f([-3,-2,-1,0,1])([-1,-1,-1,-1,-1]))); // -> [1,1,1,1,1]
console.log(JSON.stringify(f([-3,-2,-1,0,1])([2,-1,0,1,-3]))); // -> [2,2,2,2,2]
console.log(JSON.stringify(f([-3,5,5,3,1])([4,2,3,1,2]))); // -> [4,5,5,5,5]
console.log(JSON.stringify(f([4,0,2,-5,0])([0,4,-5,3,5]))); // -> [5,5,3,3,5]
console.log(JSON.stringify(f([-2,4,-2,3,2,4,1,1])([-2,4,1,2,2,3,1,-2]))); // -> [1,4,1,4,4,4,1,1]
console.log(JSON.stringify(f([-10,-20,-11,12,-18,14,-8,-1,-14,15,-17,18,18,-6,3,1,15,-15,-19,-19])([-13,6,-4,3,19,1,-10,-15,-15,11,6,9,-11,18,6,6,-5,-15,7,-11]))); // -> [-8,14,18,14,19,14,-8,-1,-1,15,14,18,18,18,14,14,15,-1,18,18]
console.log(JSON.stringify(f([20,15,2,4,-10,-4,-19,15,-5,2,13,-3,-18,-5,-6,0,3,-6,3,-17])([-18,7,6,19,-8,-4,-16,-1,13,-18,8,8,-16,17,-9,14,-2,-12,7,6]))); // -> [20,15,20,19,-8,-4,20,15,17,20,17,17,20,17,-6,14,15,-6,15,20]
console.log(JSON.stringify(f([0,-1])([-1,-1]))); // -> [0,0]

That's a lot of a.map...

@ETHproductions Yup. There might be a better way. Mildly interesting fact: the first two a.map can be replaced with b.map just as well.

I added a new test case for your situation.

CJam, 27 bytes
l~_])\z_,*f{{_2$&,*|}/:e>}p

Try it online! Test suite.
Explanation
l~       e# Read and evaluate input, dumping arrays A and B on the stack.
_        e# Copy B.
])\      e# Wrap in array, pull off B, swap. Gives B [A B] on the stack.
z        e# Transpose the [A B] matrix to get a list of all equivalent pairs.
_,*      e# Repeat this list by the number of pairs. This is to ensure that the
         e# following procedure is applied often enough to allow transitive
         e# equivalences to propagate.
f{       e# Map this block over B, passing in the list of pairs each time...
  {      e#   For each pair...
    _2$  e#     Copy both the pair and the current value/list.
    &,   e#     Get the length of their intersection. If this is non-zero,
         e#     the current pair belongs to the current equivalence class.
    *    e#     Repeat the pair that many times.
    |    e#     Set union between the current value/list and the repeated pair.
         e#     This adds the pair to the current list iff that list already
         e#     contains one value from the pair.
  }/
  :e>    e#   Get the maximum value of this equivalence class.
}
p        e# Pretty print.

Python, 86 bytes
f=lambda a,b:a*(a==b)or f(*[map({x:y for x,y in zip(a,b)if x<y}.get,x,x)for x in b,a])

Simultaneously updates both lists by replacing each value in the first list by the corresponding element in the second list if it's greater. The replacement is done with map on a dictionary's get method. Then, swaps the lists, and repeats until they are equal.

Python 2, 91 bytes
f=lambda a,b:[a<x>b.update(b&set(x)and x)and b or max(f(zip(a,b)*len(a),{x})[0])for x in a]

Php, 266 241 213 200 bytes
Solution:
function u($x,$y){foreach($x as$i=>$j){$k[$y[$i]][]=$j;$k[$j][]=$y[$i];}$h=function($c,&$w)use($k,&$h){$w[]=$c;foreach($k[$c]as$u)!in_array($u,$w)&&$h($u,$w);return max($w);};return array_map($h,$x);}

Usage: u([1,2,3], [0,0,1]); returns the desired array.
Not-so golfed:
function unify($x, $y)
{
    foreach($x as $i=>$j) {
        $k[$y[$i]][] = $j;
        $k[$j][] = $y[$i];
    }

    $h = function ($c, &$w=[]) use ($k, &$h) {
        $w[] = $c;
        foreach($k[$c] as $u)
            !in_array($u, $w) && $h($u, $w);
        return max($w);
    };

    return array_map($h, $x);
}

Pyth, 13 bytes
eMumS{s@#dGGC

Try it online: Demonstration
Explanation:
Start with each pair. Iteratively extend each pair (list) with overlapping lists, deduplicate the elements and sort. Stop once this process converges. Print the maximum of each list.

Dyalog APL, 29 28 bytes
⌈/¨({∪¨,/∘.{⍵/⍨≢⍺∩⍵}⍨⍵}⍣≡,¨)
Same idea as the Pyth solution.

Mathematica, 56 bytes
#/.($|##->Max@##&@@@ConnectedComponents@Thread[#<->#2])&

Python, 522 bytes
a = [-2,4,-2,3,2,4,1,1]
b = [-2,4,1,2,2,3,1,-2]
m = {}
visited = {}
for i in range(len(a)):
    if a[i] in m:
        if b[i] not in m[a[i]]:
            m[a[i]].append(b[i])
    else:
        l = []
        l.append(b[i])
        m[a[i]] = l
    if b[i] in m:
        if a[i] not in m[b[i]]:
            m[b[i]].append(a[i])
    else:
        l = []
        l.append(a[i])
        m[b[i]] = l

def dfs(v, maximum):
    if v > maximum:
        maximum = v
    visited[v] = True
    for n in m[v]:
        if not visited[n]:
            d = dfs(n, maximum)
            if d > v:
                maximum = d
    return maximum

result = []
for k in range(len(a)):
    for q in m:
        visited[q] = False
    result.append(max(dfs(a[k], a[k]), dfs(b[k], b[k])))

print(result)

Explanation
Make a table of values corresponding to each unique element in in both arrays (a and b in this case). For example if
a = [0,1,0]
b = [2,1,0]

then the table would be:
0:[0,2]
1:[1]
2:[0]

then apply depth first search, so, for example, assume I pick the leftmost element in a the value is then 0 and 0 has the equivalences: 0 and 2. Since 0 has already been visited, go to 2. 2 has the equivalences: 0. So the best result for choosing the leftmost element in a is 2.
Here's the tree:
   0
 /   \
0     2
       \
        0

and you want to take the largest value in there, so the result is 2.

Welcome to PPCG! In [tag:code-golf], you aim to get the shortest bytecount possible in your program. This means shortening function and variable names and removing unnecessary whitespace in your program.

You should also take the two arrays as user input instead of hard-coding them.

Java, 273 263 bytes
interface Z{int z(int x);default Z g(int m,int n){return x->{for(int t;x!=(t=x==m?z(n):z(x));)x=t;return x;};}static void f(int[]a,int[]b){Z y=x->x;int i=0,v;for(int u:a){u=y.z(u);v=y.z(b[i++]);if(u<v)y=y.g(u,v);if(v<u)y=y.g(v,u);}i=0;for(int u:a)a[i++]=y.z(u);}}

The method f(int[]a,int[]b) solves the challenge.
interface Z{

  //should return an "equivalent" integer
  int z(int x);

  //return a Z lambda where the 1st arg is "equivalent" to the 2nd arg
  default Z g(int m,int n){
    return x->{
      for(int t;x!=(t=x==m?z(n):z(x));) //always find the last equivalent number for x
        x=t;
      return x;
    };
  }

  //solve the challenge
  static void f(int[]a,int[]b){
    Z y=x->x; //start off with all numbers only equivalent only to themselves
    int i=0,v;
    for(int u:a){
      u=y.z(u); //get a's element's equivalent number
      v=y.z(b[i++]); //get b's element's equivalent number
      if(u<v)y=y.g(u,v); //if a's was smaller than b's, make a's equivalent to b's
      if(v<u)y=y.g(v,u); //if b's was smaller than a's, make b's equivalent to a's
    }
    i=0;
    for(int u:a) //overwrite a with each element's equivalent value
      a[i++]=y.z(u);
  }

}

First go through both arrays and keep track of equivalent numbers.
Then modify every element in the first array to have the equivalent numbers stored.

PHP, 132 bytes
function(&$a,$b){for(;$i<count($a);$i++){$r=$a[$i];$s=$b[$i];$r<$c[$s]?:$c[$s]=$r;$s<$c[$r]?:$c[$r]=$s;}foreach($a as&$v)$v=$c[$v];}

Anonymous function that takes two arrays.
This is my take on 'modify one of the arrays in place', as specified in the output of the challenge. This loops through each of the two arrays, records the equivalence if the current one is bigger than the one stored, then loops through the first array and replaces all the values with their largest equivalents. The first array is taken by reference (hence the &$a), so the array passed in is modified 'in place'.

Java, 170 bytes
Golfed
(a,b)->{int[]d=a.clone();for(int i=0,y;i<d.length;i++){y=0;for(int j=0;j<a.length;j++)if(a[j]==d[i]||b[j]==d[i])y=Integer.max(y,Integer.max(a[j],b[j]));d[i]=y;}return d;}

Ungolfed
(a, b) -> {                                        // Two argument lambda
    int[] d = a.clone();                           // We clone our first array for modification
    for (int i = 0,y; i < d.length; i++) {         // Going through the elements of d...
        y = 0;                                     // We initialize our 'highest' equivalent
        for (int j = 0; j < a.length; j++) {       // Going through each of our arrays (a and b)...
            if (a[j] == d[i] || b[j] == d[i]) {    // If either of them is the number we're trying to match for equivalence...
                y = Integer.max(y, Integer.max(a[j], b[j])); // We see if the new number is bigger than the largest we've found.
            }
        }
        d[i] = y;                                  // We then assign the largest equivalent number for the current position in our output array.
    }
    return d; // And return!
}

Anonymous function that takes two int[]s as arguments and returns an int[].


text:
Plot a list of numbers
Are you feeling jealousy towards Mathematica, Matlab et al. for their intricate plotting capabilities? If you answered yes, this challenge is for you!
Challenge
Given, via parameters or standard input, a list of numbers list and a positive integer h for the height of the plot, write a program/function/snippet that prints a character array of length(list) columns and h rows, where each column contains exactly one special non-whitespace character, e.g. # and h-1 spaces. For the nth column the position of the special character corresponds to the value of the nth element in the list. Lower rows correspond to lower values, so if list[a]≥list[b], then in column a the special character must be at least as high than in column b.
The scaling from the value to the y-position of the special character must essentially be an affine mapping (x ↦ ax+b) plus any necessary rounding so for example integer division is allowed but clipping is not. The scaling must be done so that the full extent of the plot is used, i.e. the first and last row contain at least one special character.
The numbers can be of any numeral type that is at least 8 bits wide. Labels or axes aren't needed. Built-in plotting functions are allowed if the output conforms to the required format. The standard loopholes are disallowed.
Example
Input:
list = [0.0,0.325,0.614,0.837,0.969,0.997,0.916,0.736,0.476,0.165,-0.165,-0.476,-0.736,-0.916,-0.997,-0.969,-0.837,-0.614,-0.325,0.0]
h = 8

One possible output:
    ###
  ##   #
 #      #
#        #         #
          #
           #      #
            #   ##
             ###

This is code-golf, so the shortest code in bytes wins!

In your example, the first and last number is 0.0 but the special character is not on the same row

@KarlNapf good catch, fixed

Is this output format acceptable?

@LuisMendo no, the output should 20 characters wide for that input and the height should be selectable, but I think it's worth putting in a non-competitive answer.

@Angs Thanks. I In fact it doesn't conform to the spec. It would be invalid rather than non-competitive

MATL, 26 bytes
tX<-tX>/iq*Yo"@Z"35h]Xhc!P

Try it online!
Explanation
tX<-    % Input array of values implicitly. Subtract minimum
tX>/    % Divide by maximum
iq      % Input height and subtract 1
*       % Multiply
Yo      % Round to nearest integer
"       % For each number in that array
  @     %   Push current number
  Z"    %   String with that number of spaces
  35h   %   Append a '#' character to that string
]       % End
Xh      % Collect all strings into a cell array
c       % Convert into 2D char array, right-padding with spaces
!P      % Transpose and flip vertically. Implicitly display

Python 2, 118 bytes
Saving 2 bytes thanks to Shebang
def f(n,L):
 for i in range(n):print''.join(' #'[i==j]for j in[n-1-int(~-n*(x-min(L))/(max(L)-min(L))+0.5)for x in L])

(n-1) -> ~-n saves two bytes by removing parenthesis :)

Switching to use n,L=input() taking the arguments as a tuple, dropping the 0 from 0.5, and saving min(L) in a variable saves 3 bytes more :)

Mathematica, 91 bytes
StringRiffle[(Join[" "~Table~#,{"#"},Table[" ",a-#]]&/@⌊(a=#2-1)Rescale@#⌋),"
",""]&

Anonymous function. The Unicode characters are respectively U+230A LEFT FLOOR for \[LeftFloor], U+230B RIGHT FLOOR for \[RightFloor], and U+F3C7 (private use) for \[Transpose]. Output for the test case:
     #
   ## ##
  #     #
 #       #
#                  #
          #       #
           #     #
            #####

JavaScript (ES6), 125 bytes

list=[0.0,0.325,0.614,0.837,0.969,0.997,0.916,0.736,0.476,0.165,-0.165,-0.476,-0.736,-0.916,-0.997,-0.969,-0.837,-0.614,-0.325,0.0];
h=8;
f=
(a,n,m=Math,u=m.max(...a),h=u-m.min(...a))=>[...Array(n--)].map((_,i)=>a.map(v=>m.round(i-(u-v)*n/h)?` `:`#`).join``).join`
`
;
console.log(f(list,h));


text:
Code Golf: BlackJack - best moves
The Challenge
I was looking into small code examples for a specific language as a small tutorial and came accross a simplified Blackjack that should be implemented. In this Challenge you will have to implement a full Blackjack game, with 5 Decks.
The Game
You are playing against a Dealer and he has 5 Decks of Poker playing cards.
A pokerdeck contains the cards "2♠","3♠",...,"K♠","A♠","2♥",...,"A♥",...,"A♣", which may be represented by their values for 2-10, Jack-King is all 10, Ace is 11.
The gamecycle begins with the Dealear giving a card to you, and one to him self. Your goal now is to reach 21, by adding the values of the cards, that the dealer gives you.
After recieving a card, you have two options:

Stay: You decide, to not be dealt additional cards, therefore determining your score for the round: the sum of cards. For example: you have a 2, a 10, and a 8, and you decide to stay, then your score for the round is 20.
Hit: You decide to be dealt an additional card. This can lead to three cases:

The total sum of your cards is under 21: Nothing really happens. Here you could again decide wether to stay or to hit again.
The total sum of your cards is exactly 21: This is the best score you can get, and makes you automatically stay. If you get 21, with 2 cards (i.e.: 10 + Ace, this is called a "Blackjack") you automatically win. Else there is still possibilities for a draw.
The Total sum of your cards exceeds 21: You busted. this is automaticaly a loose.

This is done, until you decide to stay/bust/get blackjack. Then its the Dealers turn, if you havent busted. The dealer does exactly the same. He stays/hits normally, until his score is above 17 (This is his strategy for winning). If the Dealer busts, meaning his score is above 21, you automatically win, if you havent busted yourself.
After this both you and the Dealer should have a score (i.e.: Player 20, Dealer 18). In this case the person with the higher score wins. If you draw, you draw.
The Strategy
The best strategy for the game looks like this:

Our case is slightly easier, as you cant Double and Split.
Additional notes
You may decide how to handle user input (there should obviously be some, due to the way this game is reactive), and how to do output. The carddrawing should be random, and semi-nonreproducible (C example would be: srand(time(0))).
Rules
Standard Golf rules. Shortest byte amount wins. As this is random, there arent really any good testcases, but it should look something like this:
~$ ./blackjack
You got [10]
Dealer got [7]
Suggested: Hit
[s]tay
[h]it
h
You got [3]
Suggested: Hit
[s]tay
[h]it
h
You got [7]
Suggested: Stay
[s]tay
[h]it
s
Dealer got [9]
Dealer got [10]
Dealer busted. You won.
Another round? [y/n]: y
Next round:
You got[10]
...

Unexpected input may result in undefined behaviour.
Extra
Try and include Split/DoubleDown in both userinput and Suggested moves :) Good Luck.
Notes
If my explanation of the game was satisfying for you needs here is the Wikipedia page, to the game.

Welcome to the PPCG, Jacobus! This is a really nice first question. However, I am not sure if your question is different enough from this question. The input formats are very similar, and answers from this can be translated here with ease.  Aside from that, you should clarify what the ending conditions are, i.e. be more firm: Games are played until the user decides to exit or 104 cards remain, for example. Our sandbox is a great way to get feedback :)

@Shebang thanks. Fixed it. Also very true. the basic idea is similar :/

Suggestion if the other one is too similar: Calculate basic strategy: for each possible situation (your score vs dealer's one visible card) output the move (hit or stay) that will maximize your expected value. Or have the situation (ex. 19, 10) as input and output a truthy value for hit or stay.

@JollyJoker nice Idea, however i feel like that is close to this as well. If i were to ask for what you suggested, should i rather write a whole new challenge, or rewrite this?

@JacobusConradi The constraint of having exactly one valid output for each input would make the entries very different. Modding this question should work; just remove Extras and Ending conditions and add an explanation about the "best move". Maybe calculate the full output for these simplified rules and show a chart like this

Does this answer your question? Simple One Game Blackjack


text:
Recamán's triangular fibonacci
This challenge is based upon three sequences, below are their formulae:

Recamán's sequence:

a1 = 0; for n > 0, an = an-1 - n

if positive and not already in the sequence, otherwise

an = an-1 + n

Fibonacci sequence:

an = (Φn – (–Φ)–n) / √5

where Φ denotes the golden ratio, and

a1 = 0

Triangular numbers sequence:

a1 = 0; an = n * (n+1) / 2

Your task is to take specified nth terms of each sequence and perform certain basic mathematical operations on them, namely addition, subtraction, multiplication, division, and the support of parentheses, nothing more is required.
Input is always in infix notation, and output formats are unrestricted.
Your code must be able to handle all real numbers from -10,000,000 to +10,000,000
Standard loopholes apply, and built-in functions for these sequences are not allowed.
Examples:
(These examples use an example output format of 1R = 1st term of R, 3430T = 3430th term of T, and so on, however you are free to use whichever output format you desire.)
Examples:

(1R + 1F) * 3

= ( 0 + 0 ) * 3
= 0

(1R * 1F) - 3

= ( 0 * 0 ) - 3
= - 3

(1R + 2R) + (57R - 35R) / (51R - 41R) ) + (31F + 32F) - (54T)

= { [ (0 + 1) + (30 - 113) ] / (33 - 38) } + (832040 + 1346269) - (1431)
= { [ (0 + 1) + (-83) ] / (-5) } + (2178309) - (1431)
= [ (1 - 83 ) / (-5) ] + (2178309) - (1431)
= (-82 / -5) + (2178309) - (1431)
= (16.4) + (2178309) - (1431)
= 2176894.4

Reposting deleted challenges is poor form and can lead to an automatic question ban. If a challenge of yours should be undeleted, please flag it for moderator attention.

@DrMCMoylex Regardless of suggestions in chat, having a heavily downvoted, closed, deleted question contributes to automatic question bans, which cannot be lifted by moderators. The only way of lifting the ban is to fix those questions, which isn't possible if they have already been duped.

@TheBitByte http://meta.codegolf.stackexchange.com/questions/5598/downvoting-needs-to-change

JavaScript (ES6), 164 163 148 bytes
Input format: F(n), R(n), T(n)
s=>eval(s.replace(/[FRT]/g,c=>`(F=n=>${c<'R'?'n>1?F(n-2)+F(n-1):n':c>'R'?'n*++n/2':'(N=>{for(l=[1];--n;)l[x=y+=++N>y|l[y-N]?N:-N]=1})(x=y=0)|x'})`))

Example
This may take a few seconds to complete.

let f =

s=>eval(s.replace(/[FRT]/g,c=>`(F=n=>${c<'R'?'n>1?F(n-2)+F(n-1):n':c>'R'?'n*++n/2':'(N=>{for(l=[1];--n;)l[x=y+=++N>y|l[y-N]?N:-N]=1})(x=y=0)|x'})`))

console.log(f("((R(1) + R(2)) + (R(57) - R(35))) / (R(51) - R(41)) + (F(30) + F(31)) - (T(53))"));

The input format is just an example so you could save bytes with R(1) F(30) and T(53) instead of 1R 30F and 53T

@Hedi Oh, thanks for pointing this out. I didn't pay attention to that part of the rules.

Perl, 201 199 169 + 1 = 170 bytes
Run with the -n flag.
Whitespace is provided for readability and is not part of the code.
sub R{
  $_=pop;
  %m=(@_=0,1);
  $m{push@_,$m{$a=$_[-1]-@_}||$a<0?$a+2*@_:$a}=1 for 2..$_;
  pop
}
sub F{
  @_=(0,1,@_);
  push@_,$_[-1]+$_[-2]for 3..pop;
  pop
}
sub T{
  ($_=pop)*$_++/2
}
say eval

Pretty straightforward. R calculates the nth Recaman number, F calculates the nth Fibonacci number, and T calculates the nth Triangular number.  The script accepts input of an expression with terms such as R(##), T(##), and F(##), and evaluates it.
I'm sure I can reduce the byte-count for R, but I'll have to spend more time thinking about it.

Ruby, 135 132 129 bytes
->s{R,F,T=->x{*y=r=0;(x-1).times{|i|r<<y;y=r-[z=y+~i]!=r||z<0?y-~i:z};y},->x{a,b=1,0;(x-1).times{a=b+b=a};b},->x{x*~-x/2};eval s}

Input format: string using the sequence names and subscript.
Example:
( (1R + 2R) + (57R - 35R) / (51R - 41R) ) + (31F + 32F) - (54T)

becomes
"( (R[1] + R[2]) + (R[57] - R[35]) / (R[51] - R[41]) ) + (F[31] + F[32]) - (T[54])"

Sorry for adding the missing bracket to the example, it wouldn't work otherwise. :-)
Explanation
The evalis using the definition of R, T, and F functions.
Fibonacci: my own entry in the Fibonacci contest: https://codegolf.stackexchange.com/a/103329/18535 changed to start from 0 instead of 1.
Recamán: inspired by Martin Ender's answer: https://codegolf.stackexchange.com/a/37640/18535  then golfed away a couple of bytes.
Triangular: starting from 0, instead of n*(n+1)/2 I could use n*(n-1)/2


text:
Armistice Day Challenge
Today, November 11th, is known as Remembrance Day, Armistice Day, or Veterans Day (depending upon the country), and is a day of reflection and gratitude for members of the military and their service, specifically started to reflect the end of European hostilities in the first World War. Let us reflect on that with a simple ASCII-art output of 11/11.
Given an input n, output an ASCII-art rendition of 11/11 that is n units tall. Specifically, each 1 is composed of vertical pipes ||, the slash is composed of slashes //, and each character is two spaces apart. Note that this means varying output widths -- for example, for n=3 below, see how the "bottom" of the slash is two spaces from the 1 to its left, but is four spaces from the 1 on its right, so that the top of the slash lines up appropriately and is two spaces from the 1 on its right.
n = 1
||  ||  //  ||  ||

n = 2
||  ||   //  ||  ||
||  ||  //   ||  ||

n = 3
||  ||    //  ||  ||
||  ||   //   ||  ||
||  ||  //    ||  ||

n = 4
||  ||     //  ||  ||
||  ||    //   ||  ||
||  ||   //    ||  ||
||  ||  //     ||  ||

n = 5
||  ||      //  ||  ||
||  ||     //   ||  ||
||  ||    //    ||  ||
||  ||   //     ||  ||
||  ||  //      ||  ||

and so on.
Input
A single positive integer in any convenient format, n > 0.
Output
An ASCII-art representation of 11/11, following the above rules and examples. Leading/trailing newlines or other whitespace are optional, provided that the characters line up appropriately.
Rules

Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Jelly, 24 bytes
⁾| Ḥẋ2µ,Ṛðj
⁶ẋṖ;⁾//ṙḶÇ€Y

TryItOnline!
How?
⁾| Ḥẋ2µ,Ṛðj - Link 1, join two "11"s with: middle
⁾|          - string literal: "| "
   Ḥ        - double          "||  "
    ẋ2      - repeat twice    "||  ||  "
      µ     - monadic chain separation
       ,    - pair with
        Ṛ   - reversed       ["||  ||  ","  ||  ||"]
         ð  - dyadic chain separation
          j - join with input "||  ||  middle  ||  ||"

⁶ẋṖ;⁾//ṙḶÇ€Y - Main link: n       e.g. 5
⁶            - literal ' '        ' '
 ẋ           - repeat n times     "     "
  Ṗ          - remove last entry  "    "
   ;         - concatenate with
    ⁾//      - literal "//"       "    //"
        Ḷ    - lowered range(n)   [0,1,2,3,4]
       ṙ     - rotate left        ["    //","   // ","  //  "," //   ","//    "]
         Ç€  - call last link (1) as a monad for €ach
           Y - join with line feeds

JavaScript (ES6), 57 bytes
n=>" ".repeat(n).replace(/./g,"||  ||  $'//$`  ||  ||\n")

What the... forget my answer, this is genius. I should stop going the conventional route every single time :P

That's slick. Nice answer.

Can someone explain the $' and the `$`` in the regex? I've never seen that before and would love to understand it better.

@RobertHickman They refer to the part of the string after and before the match ($& would be the match itself).

@Neil, thanks! You learn something new everyday :)

05AB1E, 24 bytes
<ð×„//J¹FD"  ||"2×ÂŠ««,À

Try it online!
Explanation
                          # implicit input n
<ð×                       # push n-1 spaces
   „//J                   # join with "//"
       ¹F                 # input times do:
         D                # duplicate top of stack
          "  ||"2×        # push "  ||  ||"
                  Â       # push "||  ||  "
                   Š      # move the top of the stack down 2 places on the stack
                    ««    # concatenate the top 3 elements of the stack
                      ,   # print with newline
                       À  # rotate top of stack left

Previous 26 byte version
F"||  "2×©ð¹N-<×„//ðN×®RJ,

Try it online!

That was fast!!

" "×"//"«.s¦R"|| || "s«vyû}» , turns out palendromize isn't a good fit, for  reasons more obvious now... and you beat my bytecount faster anyhow heh.

Perl, 45 bytes
-9 bytes thanks to @Gabriel Benamy
47 bytes of code + 1 byte for -n flag.
say$@="||  "x2,$"x$_,"//",$"x++$.,$@while$_--

Run with -nE flags :
perl -nE 'say$@="||  "x2,$"x$_,"//",$"x++$.,$@while$_--' <<< 5

Save 4 bytes by changing "||  ||" to "||  "x2 and then turning (2+$_) into just $_

I think you can also drop the +( .. ) around the $@ assignment.  It works on my computer, at least.

@GabrielBenamy I can indeed drop the +( .. ), thanks. However I can't change "|| ||" to "|| "x2 because I need two spaces between the ||.

"||  " has two spaces after the pipes (it's just not rendering correctly here for some reason), and you're duplicating that string into "||  ||  " which takes care of the extra 2 spaces from $"x(2+$_)

@GabrielBenamy Oh thanks, that would be SE formatting showing only one space in ||   when there were two them.

JavaScript (ES6), 88 77 bytes
f=(n,i=n)=>i--?`||  ||  ${" ".repeat(i)}//${" ".repeat(n+~i)}  ||  ||
`+f(n,i):""

The recursive approach may not be could not possibly be the shortest.

.map version (88 bytes):
n=>[...Array(n)].map((_,i)=>`||  ||  ${" ".repeat(n+~i)}//${" ".repeat(i)}  ||  ||`).join`
`

Array comprehension (86 bytes):
n=>[for(_ of Array(i=n))`||  ||  ${" ".repeat(--i)}//${" ".repeat(n+~i)}  ||  ||`].join`
`

for loop version (89 bytes):
n=>{for(a="",i=n;i--;a+=s+" ".repeat(i+2)+`//${" ".repeat(n-i+1)+s}
`)s="||  ||";return a}

.replace version (85 bytes):
n=>`||  ||  q  ||  ||
`[r="repeat"](n).replace(/q/g,_=>" "[r](--i)+"//"+" "[r](n+~i),i=n)

Retina, 29 bytes
.+
$*
.
xx$'//$`  xx¶
x
||

Port of my JavaScript solution. Note the space after $* and two spaces after ||.

Python 2, 76 75 71 Bytes
Still working on a shorter version, not too bad though.
n=input()
k='||  ||'
for i in range(n):print k,(n-i)*' '+'//'+' '*-~i,k

thanks mbomb007 for catching an error!

1 byte shorter: x='||  '*2;print x+(n-i)*' '+'//'+' '*i+x[::-1]

@mbomb007 You need two spaces between the 11s, not 1. That would make it equal.

That's just SE messing it up. It's still a byte shorter. https://repl.it/EViJ

@mbomb007 According to that repl.it page there are three spaces before // on the last row and two spaces after // on the first row. It should be two spaces in both cases.

Then your current program is wrong, because that's what yours does.

@mbomb007 Good point, fixed that (so I saved the byte anyways).

Batch, 130 bytes
@set s=xx//  xx
@set l=@for /l %%i in (2,1,%1)do @call
%l% set s=%%s://= //%%
%l%:l
:l
@echo %s:x=^|^|  %
@set s=%s: //=// %

Not a port of my JavaScript solution. Since |s are hard to manipulate in Batch, I use xs as placeholders and replace them on output, this conveniently also reduces my code size. Starts by setting s to the desired output for n=1 (n is passed on the command line), then inserts spaces as necessary to obtain the first line for the actual value of n, then loops through printing the string and shifting the slash left by one character each time.

BaCon, 71 bytes
A complete BASIC program in one line.
INPUT n:FOR x=1 TO n:?"||  ||",SPC$(n-x+2),"//",SPC$(x+1),"||  ||":NEXT

Nice! Is it possible to remove the space in 1 TO?

Common Lisp, 216 bytes
I'm going to state right off the bat that this is an awful solution to the challenge. Nevertheless, it works, and I'm tired.
(defun arm (n) (format t "~{||  || ~v,,,vA//~v,,,vA ||  ||~%~}" (butlast (butlast (butlast (butlast (butlast (butlast (loop for i from 1 to (+ n 1) append `(,(- (+ n 1) i) #\Space #\Space ,i #\Space #\Space))))))))))

Usage:
* (arm 4)
||  ||     //  ||  ||
||  ||    //   ||  ||
||  ||   //    ||  ||
||  ||  //     ||  ||

For some reason, instead of doing anything sane, I decided to approach this with a loop inside a format call. This loop iterates through the contents returned by the other actual loop construct at the very end, with the last six elements removed (thus the repeated butlasts). The contents of the value returned by this loop construct consist of a padding count for the front of the slashes, the padding characters (spaces), the padding count for the back of the slashes, and finally the same padding characters.
I'm rather new to Lisp, and I understand that there is definitely a lot of room for improvement here.

You should try golfing your solution (eliminating uneeded whitespace, shortening identifiers)

Welcome to PPCG!

V, 30 bytes
4i||  2Bi//  Àé XÀ«ñÄf/é Elx

Try it online!
As usual, here is a hexdump:
0000000: 3469 7c7c 2020 1b32 4269 2f2f 2020 1bc0  4i||  .2Bi//  ..
0000010: e920 58c0 abf1 c466 2fe9 2045 6c78       . X....f/. Elx

I think you could change the initial part to 5i||  <esc>3b2r/.  You'll be at a slightly different place though, and I can't read V so I'm not sure if that matters.

Ruby, 60 bytes
->n{n.times{|i|puts (a='||  || ')+' '*(n-i)+'//  '+' '*i+a}}

C, 116 94 89 bytes
c,d;f(a){for(d=a;a--;puts("  ||  ||"))for(c=-1;c<d;)printf(a-c++?c?" ":"||  ||  ":"//");}

Try it out on Ideone

R, 86 bytes
Just a simple for loop approach:
x="||  ||";n=scan();for(i in 1:n)cat(x,rep(" ",2+n-i),"//",rep(" ",1+i),x,"\n",sep="")

Retina, 40 bytes
.+
x $&$* //  x
;{:`x
||  ||
   //
  //

Try it online!
Explanation
.+
x $&$* //  x

This turns the input N into
x S//  x

Where S corresponds to N spaces.
;{:`x
||  ||

There are two things happening here. ;{: indicates that this stage and the last one should be run in a loop until they fail to change the string. : indicates that the result of this stage should be printed after each iteration and ; indicates that the final result of the loop (and therefore of the entire program) should not be printed. The stage itself just replaces the xs with ||  || on the first iteration (and does nothing afterwards), so that we now have the first line of the required output (and print it).
   //
  //

Finally, this shifts the // one character to the left, provided there are still at least three spaces left of the //. Afterwards we return to the previous stage (which now only prints the current line, since there are no more xs) and then repeat.

Ruby, 76 74 73 bytes
x="||  ||";n=gets.to_i;puts (1..n).map{|i|x+" "*(n-i+2)+"//"+" "*(i+1)+x}

As a function it takes 73 72 bytes, counting the definition:
def f n,x="||  ||";(1..n).map{|i|x+" "*(n-i+2)+"//"+" "*(i+1)+x}*?\n;end

Powershell, 66 bytes
$a=read-host;1..$a|%{$s="||  ";$s*2+" "*($a-$_)+"// "+" "*$_+$s*2}

Welcome to the site!

@DrMcMoylex Just wondering, I saw this answer and was going to do the same thing you did, but it said that I did not change enough in my edit. How were you able to do this?

@nedla2004 Once you have 1,000 reputation, (or 2,000 for fully graduated sites) you'll get full editing priveleges. Until then, all your edits have to be at least 6 characters and will be reviewed by other users with more rep. Since I have over 1,000 rep, I am allowed to submit small edits immediately.

Welcome to PPCG! You can save a couple bytes by taking command-line input instead of read-host -- param($a)1..$a|%{$s="||  ";$s*2+" "*($a-$_)+"// "+" "*$_+$s*2}

Thanks for the welcomes, the edit, and the command line suggestions all!

C#, 150 Bytes
Golfed:
string A(int n){string a="",b= "||  ||";for(int i=0;i<n;i++)a+=b+"  //  ".PadLeft(5+n-i,'\0')+string.Concat(Enumerable.Repeat(" ",i))+b+"\n";return a;

Ungolfed:
public string A(int n)
{
  string a = "", b = "||  ||";
  for (int i = 0; i < n; i++)
    a += b + "  //  ".PadLeft(5 + n - i, '\0') + string.Concat(Enumerable.Repeat(" ", i)) + b + "\n";
  return a;
}

Testing:
Console.WriteLine(new ArmisticeDayChallenge().A(11));

Output:
||  ||            //  ||  ||
||  ||           //   ||  ||
||  ||          //    ||  ||
||  ||         //     ||  ||
||  ||        //      ||  ||
||  ||       //       ||  ||
||  ||      //        ||  ||
||  ||     //         ||  ||
||  ||    //          ||  ||
||  ||   //           ||  ||
||  ||  //            ||  ||

Groovy, 63 chars/bytes
Here's my attempt with Groovy, using an anonymous closure and simple loops to print the ASCII art to standard output:
{n->n.times{println'||  '*2+' '*(n-it-1)+'//'+' '*it+'  ||'*2}}
You can try it online here. Just click "Edit in console" and then "Execute script".
Trying to do the same and returning a string instead of printing, I couldn't get below 71 bytes:
{n->a='';n.times{a+='||  '*2+' '*(n-it-1)+'//'+' '*it+'  ||'*2+'\n'};a}

Python 3, 78 bytes
a="||  ||"
def m(n):
    for e in range(n):print(a," "*(n-e),"//"," "*(e+1),a)

Still trying to shorten...

Welcome to PPCG! Might you be able to move the for onto the same line as def? (Like this: def m(n):for e in range(n):print(a," "*(n-e),"//"," "*(e+1),a)) Also, you can save two bytes by replacing (e+1) with -~e.


text:
Quine Anagrams! (Cops' Thread)
This is the cops' thread. For the robbers' thread, click here.
Cops' Task

First, write a quine in a language of your choosing.
Next, scramble the quine. Make sure to do this well as the robbers will be trying to unscramble it and find the original source code! Note that the scrambled code does not need to work.
Post an answer on this thread. Include the language, the byte count, and the scrambled code.

Your program may not print to STDERR.
Here is an example of a cop submission:

Python, 29 bytes
nt _%=_r;_riinp;pr_='t _%%%_'

Robbers' Task
For the robbers' thread, click here.
Safe Submissions
If your submission has not yet been cracked after a week of posting, you may add the solution and specify that it is safe. If you do not, your submission may still be cracked.
Scoring
This is code-golf, so the user with the safe submission with the fewest bytes will be the winner of this section.
Leaderboard
Here is a stack snippet to generate a learderboard for this challenge. For it to display properly, please format your submission like this:
# Language Name, N bytes

... other stuff ...

If your submission gets cracked, please format like this:
# Language Name, N bytes, [Cracked!](link)

... other stuff ...

If your submission is safe, format like this:
# Language Name, N bytes, Safe!

... other stuff ...

Closely related. (Same challenge except that answers didn't have to be quines.)

Is the scrambled code supposed to also be a quine? Does it even need to be a valid program? I tried running the sample Python on codepad but it gets a syntax error.

@milk No, it doesn't need to be a valid program.

C#, 288 bytes
Stag is a great shoW.        "="=""="="Agent"plastic"Was"tryin"to"Release"an"Astroid"."$Money$"st@le"tigers"and"Agent"plastic"got"mad"."$Money$"sic","man","t0tally"rad"."Sistrs"Rms"titAnic";"Civic"Ace"in"{sC@m}{hic}{vicis}..{cats}sAc}((@))((@)){{{>>{{{{{{}}}}}}}}}\\\\\\\;;;(@)((@)()),,;;

My strategy is for all the short ones to get cracked and nobody bothers with this considering how long it is... Also I suppose I should note that this is a full program, not just a function.

JavaScript, 1574 bytes, Safe!
I spent way too much time on this. Behold the obfuscation.
(notice that an unmatch parenthesis remains throughout the entire text.

dear "sir",

|    i cannot express my loathing to you and your things. they truly are a loathsome sight. (regar'less of their quality, they function as the most appalling devices...)[1]

|    these avocads of thine possession are most unpleasent. (ce n'est pas faux.) Queer; Careful; An' in total repulsing. in this form, those are not seulement cringe... So; CAB's is quite Cruel. (Cruel indeed...)

|    intention is not great (heh, intention, ;}) run, no, run, since {tu est le ;AqC;};

{{{{============================================}}}}

[1]: see? am i not insane? You may dictate the opposite, so i dictate thus.

9 + 4 is 13. Y is this. Y + 4 is 9 + 9 minus one. N is this. f(x) is {x + x}, so f(N) is N plus N is N + N is 3.

:^) i'm cruel; not so cruel.)
                                  rrrrrrrrrr 0nnnccnnggrrrrttssBBC
{({[}(<[<))(((((){{})}[}][[]{}(]))))|} f f r 0nnnccnngrrrrrttesBBA
())(((()))))()))()()()((((()))}{{})((} f f r 0nnnccnngrrrrrttesBBY
]]}(([][]{{{}}})()({}(){}{()}{}()[])][ f f r 4nnnccnngrrrrrttesBSY
))({})(}{)({{{{(()))())))))))()))()()( f f r 4nnnccnngrrrrrtpesqSY
)()()((((((((((Z))))))))()(()((()((((( f f r 5nnnccnngrrrrrtlefoSY
(((;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''' f f r 3nnncccngrrrrxtleifSY
''''''''''''''''''',,,,,,,,[[[[[[]]]]] f f r 3nnncccngrrrrxtleifZQ
[ ] ] + + + + + + + + + + + + + + + ++ f f r 9nnncccggrrrrxtleifZQ
+ + + + too not fun...fffffffffffffuuu f f r 5nnncccggrrrrxtlli0ZQ
uuuuuuuuuuuu.. | | | |99S            ) f f r 0nnncccggrrrrxxll01QQ

Here's the original source!

function Y(x){return x.charCodeAt()};
function Q(x){return String.fromCharCode(x)};
N=Array.prototype;
function B(f,g,h){return function(){
  return f(g.apply(h||this,arguments));
}};
function S(f,h){return function(){
  return f.apply(h||this,N.reverse.call(arguments))}}
function id(x){return x};
function format(){
  args = N.slice.call(arguments);
  str = args.shift(); res = []+[];
  for(i = 0; i < str.length; i++){
    c = function(){return str[i]};
    if(B(Y,c) == 95){
      res += args.shift();
    } else if(S(B)(c,Y)() == 94){
      res += q = B(id,Q)(34);
      res += args.shift();
      res += q;
    } else if(Y(c()) == 39){
      i++;
      res += c() == ([][0]+[])[1] ? Q(10) : []+[];
    } else res += c();
  }
  return res;
}
console.log(format(Z="function Y(x){return x.charCodeAt()};'nfunction Q(x){return String.fromCharCode(x)};'nN=Array.prototype;'nfunction B(f,g,h){return function(){'n  return f(g.apply(h||this,arguments));'n}};'nfunction S(f,h){return function(){'n  return f.apply(h||this,N.reverse.call(arguments))}}'nfunction id(x){return x};'nfunction format(){'n  args = N.slice.call(arguments);'n  str = args.shift(); res = []+[];'n  for(i = 0; i < str.length; i++){'n    c = function(){return str[i]};'n    if(B(Y,c) == 95){'n      res += args.shift();'n    } else if(S(B)(c,Y)() == 94){'n      res += q = B(id,Q)(34);'n      res += args.shift();'n      res += q;'n    } else if(Y(c()) == 39){'n      i++;'n      res += c() == ([][0]+[])[1] ? Q(10) : []+[];'n    } else res += c();'n  }'n  return res;'n}'nconsole.log(format(Z=^,Z))",Z))

avocads cracks me up!

MATL, 20 bytes. Cracked
It'D-whoLl&w#ck'f0Gz

Don't attempt to crack this. It'd wholly wack fogs.

Cracked

CJam, 39 bytes, Safe
!""$)+023345679:AEORYZZ\_```bbceeffimmz

Solution:

 ")A!0z`eZOmRZ$Yei`E"_`\32fm95b67b43f+:c

 Uses some base encoding for obfuscation. However, since the characters are all in ASCII I would have thought someone might be able to figure out 32fm95b??b??f+:c which would be enough to brute force the rest.

I didn't know how to choose a permutation if I answered. Sorting is a good idea

Underload, 20 bytes, Cracked!
~*)(a):*(*a:S(*S*~S)

I scrambled this via randomizing the order of the characters, because what could be more scrambled than random?
A correctly written Underload interpreter crashes when seeing a newline at the top level of the program. As usual in golfing competitions, there's no newline at the end of the program; I'm just placing this reminder here because it's very easy to add one by mistake when copying the program to an interpreter.

Welcome to PPCG! :)

Well, I've been commenting indirectly on PPCG for a while by tracking down PPCG users on other forums (Reddit, IRC, etc.) and shouting at them until they post what I want. May as well do it directly :-)

Cracked. Thanks, this was a fun challenge. :)

Retina, 20 bytes, Cracked
S`(\?)\1*

S`(\?)\1*

The program (and output) contains exactly two linefeeds.
You can try Retina online here.
A small hint:

 In the process of designing this cop, I found a new shortest Retina quine, which I'll post to our quine challenge once this answer is either cracked or safe.

I'm going to guess that there's a dry run * in there, and a \ as a configuration option to prevent an additional linefeed.

Pyth, 38 bytes, Safe
Not quite golfed, but works.
````::""@@@@++++22ggKKKKKKKKNNNNZZZZ

Unsorted version:
K"K++@KZ:`K@`NZNgK2"++@KZ:`K@`NZNgK2

I have a quine but it's missing two of the @ and one 2... It's so close!

Quick ! You don't have much time !

I think it's over.  I can't figure it out... :(  Congrats on getting a safe solution!

There you have the solution ! Out of curiosity, what was the quine you found ?

I had K"K2:K@Kg\Z`Z++NKN":K@Kg`Z`Z++NKN`.

Python 2, 54 bytes, Cracked!
=l`;lrt,]l n`p,i=,' 1,1'lnt[ll[;,0  ]['r[`][`0'ipll] ]

Cracked

Vim, 22 bytes, Cracked!
pit^[^[p00tqqqq^V"ltxltx"

The ^[ are the literal escape key, and ^V is Ctrl-V, and are therefore counted as one byte, and are kept together in the scrambled code.

Cracked!

V, 20 bytes -- Safe!

"$033lpqxx|áäéééñññ

Note the trailing newline.
I wasn't really sure how to scramble them, so I just sorted the characters by ASCII value.
Unlike most V answers, this one contains zero unprintable characters. Here is a hexdump:
0000000: 2224 3033 336c 7071 7878 7ce1 e4e9 e9e9  "$033lpqxx|.....
0000010: f1f1 f10a                                ....

Unscrambled code:

éññ3äl0éé$áx3|"qpñx

Try it online!
Side not about this link. In previous versions of V, a newline was always automatically printed, which is why this version has the trailing newline. The interpreter at the time I wrote this was a valid quine, although now you can just remove the newline to make it valid.
Explanation:
éñ                      " Insert a 'ñ' character
  ñ              ñ      " Put all of the following into register 'q' and run it when it's done recording
   3äl                  " Make 3 copies of the character under the cursor
      0                 " Move to the first column
       éé               " Insert an 'é' character
         $              " Move to the last column
          áx            " Append an 'x'
            3|          " Move to the third column
              "qp       " Paste register 'q' (all of the commands we just ran)
                  x     " Delete a character

Haskell, 86 bytes, cracked by nimi
putStr$"Study:ric====>>>>yummy:candy:circus:party:in:syrirrr!!!!!!$[;['=['[$]']='];]$"

This a valid Haskell expression which prints:
Study:ric====>>>>yummy:candy:circus:party:in:syrirrr!!!!!!$[;['=['[$]']='];]$

So if Ric studies, he can go to the yummy candy circus party! That is, if he figures out where Syrirrr is.

my guess

JavaScript, 147 bytes, Cracked by ETHProductions
I'll be very impressed if someone manages to crack this...
   """"''''((((()))))+++++++++.//99;;;;;;=========>>[[[[[]]]]]``````````````cccdddddddeeeeeeeeeeeffiiiiiiinnnnnnnoooooooorrrrrrrrsttttuuwwwwwwx{{}}

Intended solution:
e=o=>{n=o;``[r=`constructor`][r](`return e=>{`+o+`}`)````};d=e+"";e`for(i in window)if(/ert/.exec(i))w=window[i];w('e='+d+';d=e+"";e'+d[9]+n+d[9])`

@ETHproductions Yeah, there's no l for alert or console.log, no m for confirm or prompt... Yeah I'm evil >:D  Should I award a bounty to the cracker?

Well, there's this function that returns rather than alerting (and I'm pretty sure the OP's version worked like that to), and I could easily do the same to your solution... but is that legal?

@ETHproductions that would totally ruin it :( I'm going to say no, but if popular opinion dictates otherwise I guess that breaks most JS challenges

Yeah, I don't like return-quines, but I'm 99% sure there's no other way to crack that particular solution. I'll try to get a valid crack for yours though :)

@ETHproductions I may have made it a liiiiiiitle too hard in hindsight, but good luck!

Wait, is it a full program or a function that you have to call manually?

@ETHproductions Full program.

Cracked :)

I like the for(i in window)if(/ert/.exec(i)) trick for avoiding al.

Haskell, 99 bytes, Safe
"super.quine?"=>#$$$%%%%%&&(())))**++++,,,,/;<<==>>STaabbdeffggghhhjlmmnoppqqrrsssttttuuuvvwwwwxxxx

Another Haskell quine, this time with a nice odd 99 bytes.

 g%w=(g< $ >w)++w++pure(g.last$w);main=putStr$pred%"h&x>)h=%?x*,,x,,qvsf)h/mbtu%x*qvuTus%qsfe&#"
Try it on Ideone. The spaces in "g< $ >w" must be removed, I put them there because otherwise the <,$, and > vanish (most likely being interpreted as html tag).
 The gibberish string is a string of the program with each char mapped to it's successor, including a final " (which is possible to include into the string without escaping because it's mapped to #). The helper function % takes the string and maps each char to it's predecessor using pred (yielding code"), then appends the original string (yielding code"gibberish_code) and the last char of the decoded string (yielding code"gibberish_code"). To convert a char c to a string it would normally suffice to put it into a list [c] as strings in Haskell are simply char lists, however the successor of [ is \, which would need escaping in the successor-encoded string, so instead pure is used which lifts arbitrary types into a Monad (which Monad to use is inferred from the context).

Almost there. I have an additional space and !, but don't know how to get rid of it. Nice idea, have a +1.

@nimi Tahnks, I'm curious what your approach did differently.

I had g%w=g w++w++pure(last.g$w);main=putStr$(pred<$>)%"...#". So basically I failed to move the <$> into the function %. Now that I see your solution it's obvious.

PHP, 110 bytes, Cracked
php$=))$)<9 php .(().)'heroes ?  $0(9carrot3?$;<.()trash3,.((3=)catarrh$$9 (,'9cry(3);  ;;tryccchhhrrrrxxxxxx

You have a carrot!

"... just for one day"

Cracked.

Javascript ES6, 49 bytes (cracked)
{{$((((((('`fuck rent =+> turn off fin`')))))))}}

Is it bad if I focused more on forming coherent words in the scrambled solution?
In any case, this is my first Cops and Robbers challenge.
Update: see comments for cracked code.

Cracked.

FurryScript, 199 bytes, Safe!
UT  TTEDU DT   T U T D   ES DGT GEL L   GL
-<<<<<<+++++++[[[[#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#]]]]+++++++>>>>>>-

X   XG WPW   SS  X  PW S US WWTLWP  XS  PE

Should be fairly easy to crack.
Unscrambled Code
BESTQUINE[ DUP LT +SW +GT +< BESTQUINE#> ]
EVER![ DUP EX+ SW EX- LT +SW +GT +< EVER!#> ]
<BESTQUINE[ DUP LT +SW +GT +< BESTQUINE#> ]> BESTQUINE#
<EVER![ DUP EX+ SW EX- LT +SW +GT +< EVER!#> ]> EVER!#

Just the regular quine, but with two subroutines and some more code to swap the strings.

Vim, 17 bytes
<CR>""&(())::::\npps

The <CR> is Enter (^M or ^J) in the input and an added newline in the output. It is not the implicit end of file newline (see :help 'eol'). The 17 bytes are what is added to an empty buffer. (Newlines in a text editor are weird; let me know if this isn't clear.)

Python 2, 105 bytes, Cracked!
    ######%%%%''(((((((())))))))****--0011::::;;==@@@@@@@@@@[[[[]]]]aaaaaaggggggiiiiiiiinnpprrrrrrrrrtt~~

The other one was cracked, so this one is more difficult.

print'To find the solution, get to work!'

Cracked?

@Sp3000 Oh gosh yeah, but I actually had an original quine doing something more than that. Anyways, you did it the lazy way :P

><>, 36 bytes, Cracked!
!!!'''***+...00002333:::;???dddforrr

Cracked.

Befunge-93, 15 bytes, Cracked!
:::@#%+-_,<910g

Try it online!

Cracked. It's somewhat questionable though whether a quine based solely on g counts as a proper quine.

I'm aware that this is a standard quining technique for Befunge, but as far as the rules of this community is concerned, the linked meta post is the accepted guideline for what counts as a quine.

Ruby, 53 bytes - Cracked
**TEN sTupID,sTupID NET,"TIN"<22"DEN"<<It<DEtINDE\n\n

The \n are literal newlines.

Cracked.

QB64, 89 bytes
(_+cad:effecs:fact), =+cred:scarf:attaccd?, =+eff4c3d:cars:craccd?, (_+csc:f4c3d:fact), "

Some salient points:

The code will not work in QBasic: it uses QB64-specific features
Syntax expansion is off
No dollar signs and only one quotation mark
"Poetry" would be a stretch, but it does rhyme

Befunge-93, 24 bytes
I'm afraid this is a bit late, but I wanted to attempt one without the g command.
<<_:@00278899p,**++###>!

Try it online!

OIL, 77 bytes, Safe
0
0
1
1
1
1
1
1
1
1
1
2
2
4
4
4
6
8
10
11
11
11
12
17
18
18
18
18
22
26
26
32

Good luck with that.
Solution, "commented" (remove comments before running or it won't work):
0 # nop twice
0
1 # copy element from cell 1 to 1 (so do nothing again)
1
1
4 # print what's in cell 1 (a zero)
1
11 # print a newline
4 # and the same thing again; printing zero and a newline
1
11
1 # copy what's in cell 2 (a 1) into cell 2
2
2
1 # copy what's in cell 12 (two lines before; a 2) into cell 18
12
18
10 # check if the value in the cell of the following line (starting with 2; we'll jump back here)
18 # (this is cell 18)
1 # is equal-ish to the one in cell 1 (a zero)
32 # if yes, jump somewhere
22 # otherwise jump one cell ahead
1 # copy what's currently in cell 18 (first a 2) into cell 26
18
26
4 # print cell 26
26
8 # increment cell 18
18
11 # print a newline
6 # and jump back to cell 17
17

So to summarize, it works by first printing two zeros, and then comparing every line starting with the third one with zero, and if it isn't zero, printing it, else exiting (since OIL reads zero from any empty/non-existent cell). Any variable lines contain the value they have when they are printed (since I'm lazy, I obtained this by first making a near-quine where those cells have some arbitrary non-zero value, and using the result, which is a quine).

Jelly, 3 bytes, Cracked!
Ṙ”Ṙ

Try it online!
Here is the solution:

What, you want the solution? Find it!

Cracked...

@MartinEnder Of course!! I didn't except this to last for 1 minute at all, though. And I expected Dennis to do it first, but nevermind.

To downvoters: This just had to be posted.