text:
Make an inversedict
Input
A dictionary with string keys and string values.
Output
The 'inversedict' of this dictionary.
How to make an inversedict
An inversedict is a dictionary with string keys and string array values. The keys are the values from the original dictionary, and the values are the keys from the original dictionary with that value from the original dictionary.
An example
Input
["Clyde": "blue", "Sarah": "blue", "Fred": "green"]
Output
["blue": ["Clyde", "Sarah"], "green": ["Fred"]]

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

Does our language need to have dictionaries? Can we use a list of tuples?

@xnor, that's allowed if your language does not have dictionaries

Wait, isn't a defaultdict a dictionary that defaults to some value or function on a missing key? This looks like an "inverse" of a dictionary.

@xnor, yeah that makes a lot more sense :)

Haskell calls this flipAL with AL for association list (from Data.Lists). You might want to ban built-ins that do this.

You've allowed other data structures besides dictionaries, e.g. a list of tuples. Whatever we use, do input and output dictionary have to be of the same format?

Are the values of the input guaranteed to be distinct?

@nimi, yeah, although the output will have string array keys instead of just string

@PeterTaylor, the keys will be distinct, though the values will not necessarily, as seen in the example

Mathematica, 28 bytes
Merge[Reverse/@Normal@#,#&]&

The input is an Association, the output is an Association too.
Explanation
Normal@#

Convert the input Association to a List of Rules.
Reverse/@ ...

Reverse the Rules.
Merge[ ... ,#&]

Merge all Rules, grouping duplicates with a List and then with the identity operation. Creates an Association.
Usage
Merge[Reverse/@Normal@#,#&]&[
 <|"Clyde" -> "blue", "Sarah" -> "blue", "Fred" -> "green"|>
]

<|"blue" -> {"Clyde", "Sarah"}, "green" -> {"Fred"}|>

Python 2, 54 bytes
lambda i:{i[k]:[a for a in i if i[a]==i[k]]for k in i}

Usage:
f=lambda i:{i[k]:[a for a in i if i[a]==i[k]]for k in i}
print f({"Clyde": "blue", "Sarah": "blue", "Fred": "green"})

Gives
{'blue': ['Sarah', 'Clyde'], 'green': ['Fred']}

Brachylog, 10 bytes
tᵍ⟨ttʰhᵐ⟩ᵐ

Try it online!
Takes input as a list of [key, value] pairs through the input variable, and outputs a list of [value, [keys]] pairs through the output variable.
 ᵍ            Group the elements of
              the input
t             by their last elements.
         ᵐ    For each group,
   t          its last element
  ⟨     ⟩     paired with
      hᵐ      the first element of every element
     ʰ        with the first element of the pair being replaced by
    t         its last element
         ᵐ    is the corresponding element of
              the output.

...such an eloquent explanation...

Pyth, 10 bytes
uXeHG]hHQH

Try it online!
uXeHG]hHQH   Implicit: Q=eval(input()), H={} (empty dictionary)
u       Q    Reduce elements of Q...
         H   ... starting with an empty dictionary...
             ... current value is G, next value is H:
 X  G          Add to G...
  eH           ... with key as last element of H (i.e. value from original input dictionary)...
     ]hH       ... value as first element of H, wrapped in a list
               This adds a new single-element list if the key is not alrady present, or concatenates values if it is

Rust, 127 bytes
use std::collections::HashMap as H;|m:H<String,String>|{let mut n=H::new();for(k,v)in m{n.entry(v).or_insert(vec![]).push(k)}n}

Try it online!

Japt, 9 7 bytes
Input is as a 2D-array: [[key,value],[key,value],...].Output is as a 3D-array: [[value,[key,key,...]],[value,[key,key,...]],...].
If we can ouput the pairs in reverse order then the Ô can be removed, an the v replaced with o to save a byte.
üÌ®ÕÔvÎ

Try it
üÌ®ÕÔvÎ     :Implicit input of array
ü           :Group and sort by
 Ì          :  Last element of each
  ®         :Map
   Õ        :  Transpose
    Ô       :  Reverse
     v      :  Modify first element
      Î     :    Get first element

If output must be a 2D-array then:
10 8 bytes
üÌc_ÕÔvÎ

Try it
The _, essentially, serves the same purpose as the ® above and the c flattens the array by one level afterwards.

Lua, 82 Bytes
function(t)g={}for k,v in pairs(t)do g[v]=g[v]or{}g[v][#g[v]+1]=k end return g end

An anonymous function which takes a table as an input and outputs the inverse dict.
Commented and Ungolfed.
function(t)                     #Anonymous Function.
    g={}                        #Define the output array.
    for k,v in pairs(t) do      #For each value in the input by key value pairs.
        g[v]= g[v] or {}        #Set the value of the output dictionary with the key v, to either itself, or a new table if it's null.
        g[v] [#g[v]+1] = k      #Set a new value (#g[v]+1 is the key that is +1 the count, lua is 1 indexed) to the key.
    end                         #This loop will append values with the same 'key', instead of set. However, makes all output in table form.
    return g                    #Output g
end                             #End

JavaScript (ES6), 57 bytes
d=>eval("r={};for(i in d)(r[j=d[i]]=r[j]||[]).push(i);r")

Input and output are as Objects, e.g. {"Clyde": "blue", "Sarah": "blue", "Fred": "green"}

Just wondering since I don't know much about JS, why do you need to put this in an eval()?

@Shebang You don't have to, but d=>{r={};for(i in d)(r[j=d[i]]=r[j]||[]).push(i);return r} is one byte longer because of the return.

Ah, that explains it :) Nice answer!

C#6, 136 bytes
using System.Collections.Generic;using System.Linq;ILookup<string,string>F(Dictionary<string,string>d)=>d.ToLookup(x=>x.Value,x=>x.Key);

repl.it demo
Seriously, do I really need to ungolf this? Just create an ILookup with input value as output key and input key as output value.

C++17, 158 bytes
#import<string>
#import<map>
#import<vector>
[](auto m){std::map<std::string,std::vector<std::string>>n;for(auto x:m)n[x.second].push_back(x.first);return n;}

Ungolfed and usage:
#include<iostream>
#include<string>
#include<map>
#include<vector>

auto f=
[](auto m){
 std::map<std::string,std::vector<std::string>>n;  //using namespace is equally long
 for(auto x:m)
  n[x.second].push_back(x.first);
 return n;
}
;

using namespace std;

int main(){
 map<string,string> m={
  {"a","x"},{"b","x"},{"c","y"}
 };
 auto n = f(m);
 for (auto x:n){
  cout << x.first << ": ";
  for (auto y:x.second)
   cout << y << ", ";
  cout << "\n";
 }
 cout << "\n";
}

Factor, 27 bytes
[ [ last ] collect-key-by ]

05AB1E, 10 (or 9) bytes
.¡θ}εø`н‚R

Input as [[key,value],[key,value],...]; output as [[value,[keys]],[value,[keys]],...].
Try it online.
If it's allowed to output as [[[keys],value],[[keys],value],...] instead, it can be 1 byte less by removing the trailing R:
Try it online.
Explanation:
.¡ }        # Group the pairs of the (implicit) input-list by:
  θ         #  Their last item
    ε       # Then map over each group of pairs:
     ø      #  Zip/transpose; swapping rows/columns
      `     #  Pop and push the list of keys and list of values separately to the stack
       н    #  Pop and leave just the first item of the values-list
        ‚   #  Pair it with the keys-list
         R  #  (optional: Reverse the [[keys],value] pair to [value,[keys]])
            # (after which the result is output implicitly)

JavaScript, 47 bytes
Input as a 2D array, output as an object.
a=>a.map(([k,v])=>i[v]=[...i[v]||[],k],i={})&&i

Try it online!

Jelly, 8 bytes
ZQż¹ƙɗ@/

Try it online!
Input as a list of [key, value] pairs, output as a list of [value, keys] pairs.
Z   ɗ@/    With the keys on the right and the values on the left:
  ż        Zip
 Q         the unique values with
   ¹ƙ      the keys grouped by value, in order of the value's first appearance.

Nibbles, 6 bytes
.=~$@~/.$@$.

Attempt This Online!
Takes and outputs a list of pairs.
.  Map
=~  group by
$    [input]
@    [second element]
~   pair
/    fold
.     map
$      [the group]
@      [second element]
$     [value]
.    map
      [the group]
      [first element]

5 bytes if we allow the output to be in the format [(values, key)] rather than [(key, values)]:
.=~$@~`'$/

Attempt This Online!

Uiua, 11 bytes
∵⊂⊝:⊕□⊛,⍘⊟⍉

Try it!
∵⊂⊝:⊕□⊛,⍘⊟⍉
          ⍉  # transpose
        ⍘⊟   # uncouple
       ,     # over
      ⊛      # classify
    ⊕□       # group by box
   :         # flip
  ⊝          # deduplicate
∵⊂           # zip

Perl, 36 bytes
This is an anonymous function which takes a hash (not hash reference) as an argument, and returns a hash (not a hash reference) as its result. (A "hash" is Perl's name for a dictionary.) Although the language has dictionaries, it doesn't have sets; thus, for the values of the inverse dictionary (which are logically sets), I used the common Perl representation of a set as a hash, in which the keys are the set elements and the values are irrelevant.
Here's the program itself:
sub{my%t;$t{+pop}{+pop}++while@_;%t}

Here's how I tested it:
use Data::Dumper;
$f = sub{my%t;$t{+pop}{+pop}++while@_;%t};
my %test = qw/sky blue sea blue grass green/;
print Dumper({&$f(%test)});

The dump of the resulting hash is:
$VAR1 = {
          'blue' => {
                      'sky' => 1,
                      'sea' => 1
                    },
          'green' => {
                       'grass' => 1
                     }
        };

which is the expected value.

Haskell, 55 bytes
foldl(\l(k,v)->maybe(v,[k])((,)v.(k:))(lookup v l):l)[]

This uses the good old association list as the data structure, which means that the output list may contain multiple elements with the same key, where only the first one is valid. However, I exploit the fact that the keys in the input list are all distinct.
Usage example:
*Main> foldl(\l(k,v)->maybe(v,[k])((,)v.(k:))(lookup v l):l)[] [("Clyde","blue"),("Sarah","blue"),("Fred","green")]
[("green",["Fred"]),("blue",["Sarah","Clyde"]),("blue",["Clyde"])]

How it works:
foldl(   )[]                    -- starting with the empty list, reduce the
                                -- input list
    \l (k,v)->                  -- with via a lambda function that takes a list l
                                -- (the output list so far) and a key-value-pair
                                -- (k,v) from the input list and returns the next
                                -- version of the output list, which is made by:
                          :l    -- prepend to the existing list
      maybe   (lookup v l)      -- if v is already a key in the output
           (,)v.(k:)            --     prepend k to the list for v
                                --     (this leaves the current pair in places and
                                --     adds the updated version to the front)
         (v,[k])                -- else a new pair with v and k flipped
                                --     and k put into a singleton list

Racket 208 bytes
(let p((l2(remove-duplicates(map(λ(x)(list-ref x 1))ll)))(ol'()))(cond[(empty? l2)(reverse ol)][
(p(rest l2)(cons(cons(first l2)(for/list((i ll)#:when(equal?(first l2)(list-ref i 1)))(list-ref i 0)))ol))]))

Ungolfed:
(define (f ll)
  (define l2 (remove-duplicates (map (λ (x) (list-ref x 1)) ll)))
  (let loop ((l2 l2)
             (ol '()))
    (cond
      [(empty? l2) (reverse ol)]
      [else
       (define tl (for/list ((i ll) #:when (equal? (first l2) (list-ref i 1)))
                    (list-ref i 0)))
       (loop (rest l2) (cons (cons (first l2) tl) ol))
       ])))

Testing:
(f '[("Clyde" "blue") ("Sarah" "blue") ("Fred" "green")])

Output:
'(("blue" "Clyde" "Sarah") ("green" "Fred"))

R, 79 69 bytes
function(l)setNames(lapply(u,function(x)names(l)[l==x]),u<-unique(l))

R does not have a dictionary by default but the closest approximation to a dictionary is an object of class list. It's basically a generic vector allowing for multiple data types where each value (can basically be any R-object) is allowed to have a name/key.
Example
A list with keys/names can be created as e.g.:
l <- list(Clyde="blue", Sarah="blue", Fred="green")

Which if printed returns:
$Clyde
[1] "blue"

$Sarah
[1] "blue"

$Fred
[1] "green"

Calling the function now returns:
$blue
[1] "Clyde" "Sarah"

$green
[1] "Fred"

Groovy, 56 53 bytes
{m=[:];it.each{k,v->if(!m."$v"){x=m."$v"=[]};x<<k};m}

Testing
({m=[:];it.each{k,v->if(!m."$v"){x=m."$v"=[]};x<<k};m})(["Clyde": "blue", "Sarah": "blue", "Fred": "green"])

Output
[blue:[Clyde, Sarah], green:[Fred]]

Java 7, 211 205 bytes
golfed:
Map<String,List<String>>i(Map<String,String>m){Map<String,List<String>>r=new HashMap<>();for(String k:m.keySet()){String s=m.get(k);if(r.get(s)==null)r.put(s, new ArrayList<>());r.get(s).add(k);}return r;}

ungolfed:
public static Map<String, List<String>> i(Map<String, String> m)
{
    Map<String, List<String>> r = new HashMap<>();
    for (String k : m.keySet())
    {
        String s = m.get(k);
        if (r.get(s) == null)
            r.put(s, new ArrayList<>());
        r.get(s).add(k);
    }
    return r;
}

Test it online!
Java ... the worst golfing language.

Go, 107 bytes
type S=string
func f(m map[S]S)map[S][]S{O:=make(map[S][]S)
for k,v:=range m{O[v]=append(O[v],k)}
return O}

Attempt This Online!

Raku, 28 bytes
{push my Array%: .antipairs}

Try it online!
Raku hashes have an antipairs method that returns a list of the value-key pairs, and a push method that adds any number of key-value pairs, accumulating values associated with duplicated keys into arrays.  So this answer could almost be just:
{push {}: .antipairs}

...but unfortunately the push method doesn't create an array value unless there actually is a duplicated key.  In the provided example, it would associate the key "green" with the string "Fred", not the array ["Fred"].  So I address that by declaring that the anonymous returned hash has values of type Array.

Scala 3, 47 bytes
_.groupBy(_._2).map{case(k,v)=>k->v.keys.toSeq}

Attempt This Online!


text:
Is it a stochastic matrix?
A stochastic matrix is a matrix of probabilities used in the context of Markov chains.
A right stochastic matrix is a matrix where each row sums to 1.
A left stochastic matrix is a matrix where each column sums to 1.
A doubly stochastic matrix is a matrix where each row and each column sums to 1.
In this challenge, we will represent the probabilities in percent using integers. A row or column must in that case sum to 100 and not 1.
Your goal is to write a program or function which, given a square matrix of integers as input, outputs one of four values indicating that the matrix is either right stochastic, left stochastic, doubly stochastic or none of those.
Input
You may use any proper representation of a matrix that is natural for your language for the input. For example, a list of lists, a string of comma separated values with rows separated by linebreaks, etc.
The input matrix will always be square and will only contain non-negative integers. The input matrix will always be at least 1×1.
You may pass the input using STDIN, as a function argument, or anything similar.
Output
You must choose four distinct outputs that correspond to right stochastic, left stochastic, doubly stochastic or none of those. Those outputs must be constant regardless of what input is passed. Your program may not return different outputs for the same case, e.g. saying that any negative number corresponds to none of those is not valid.
In short, there must be a 1-to-1 correspondence between your output an the four possible cases. Some examples of those four outputs would be {1, 2, 3, 4} or {[1,0], [0,1], [1,1], [0,0]} or even {right, left, doubly, none}.
Please indicate in your answer the four outputs your program uses.
If a matrix is doubly stochastic, then you must return the output corresponding to doubly stochastic, and not right or left stochastic.
You may print the output to STDOUT, return it from a function, or anything similar.
Test cases
[100]               => Doubly stochastic

[42]                => None of those

[100  0  ]          => Doubly stochastic
[0    100]

[4   8   15]
[16  23  42]        => Left stochastic
[80  69  43]

[99  1 ]            => Right stochastic
[2   98]

[1   2   3   4 ]
[5   6   7   8 ]    => None of those
[9   10  11  12]
[13  14  15  16]

Scoring
This is code-golf, so the shortest answer in bytes wins.

Can I take an input determining the size of the matrix first?

@AlexL. No, this would be unfair to change the specs at this point.

05AB1E, 13 11 10 bytes
Right stochastic:  [0,1]
Left stochastic:   [1,0]
Doubly stochastic: [1,1]
None of those:     [0,0]
Dø2FOTnQPˆ

Try it online!
Explanation
D            # duplicate input
 ø           # transpose the copy
  2F         # 2 times do (once for each matrix)
    O        # sum of the rows
     TnQ     # is equal to 100
        P    # product
         ˆ   # add to global list
             # implicitly print global list at the end of the program

Haskell, 57 55 bytes
import Data.List
s a=all((==100).sum)<$>[transpose a,a]

Input of type (Eq a, Num a) => [[a]]. Outputs boolean list [left-stochastic, right-stochastic]
Thanks to @proudhaskeller for saving 2 bytes

Couldn't you save some bytes by making the function pointfree? e.g. with [transpose,id]<*> (then you could omit the s a= as anynomous functions are allowed)

@flawr possibly, but [transpose,id]<*> has a type of [[[a]]]->[[[a]]], which needs another layer of map and a pure/return/(:[]) or a input of type [[[Int]]], which isn't natural. Best I got is map(all(==100).map sum).(<$>[transpose,id]).flip id

Ah right, thank you for the explanation!

How about all((==100).sum) instead of all(==100).map sum?

@proudhaskeller of course! all does a mapping in itself.

R, 55 bytes
function(m)c(all(colSums(m)==100),all(rowSums(m)==100))

Unnamed function where m is assumed to be an R-matrix.
Output:

[1]  TRUE FALSE: Left stochastic
[1]  FALSE TRUE: Right stochastic
[1]  TRUE TRUE: Doubly
[1]  FALSE FALSE: None

any(colSums(m)-100) and likewise for the rowSums will drop you two bytes while inverting all the outputs, so if you'd like to keep those, you can always put a ! in front for net -1 byte.

Octave, 35 34 32 31 bytes
@(n)any([sum(n);sum(n')]-100,2)

Call it like this:
f(100)
f(42)
f([4,8,15; 16,23,42; 80,69,43])
f([99,1;2,98])
f([1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16])

Test it here.
Saved 2 bytes thanks to flawr initially, but went for another approach that was 1 byte shorter.
This outputs the following for the different cases:
0    Doubly
0

1    None
1

0    Left
1

1    Right
0

The last ,2 would be unnecessary if single digits weren't included. Also, if this summed to 1 instead of 100 (as it could have), it would save another 4 bytes.

k, 21 19 bytes
{min'100=+/'(x;+x)}

Output

00b none
10b left
01b right
11b both

Example:
k)f:{min'100=+/'(x;+x)} //store function as f
k)f(100 0;98 2)
01b

edit: reduce byte count by 3 - function does not need to be enclosed in a lambda
edit: reduce bytecount by 2 - H/T @Simon Major

You can actually save a byte by enclosing in a lambda:
{min'100=+/'(x;+:x)}

Mathematica 29 Bytes
{}⋃Tr/@#=={100}&/@{#,#}&

substituting the =U+F3C7=[\Transpose] character.  This code snippet will paste correctly into Mathematica.
Same truthiness convention with {lefttruth, righttruth} as output

{}⋃ saves one byte over Union@

@ASimmons, thanks for the tip! Put it in and corrected an error in my byte total.

Also I think if you make your output {righttruth, lefttruth}, then replacing Total@ with Tr/@ will save a further 2 bytes.

Or equivalently reverse the two matrices so the solution becomes
{}⋃Tr/@#=={100}&/@{#,#}&

@ASimmons, Yes, that saved another 2.  Thanks!

MATL, 12 bytes
sG!sv!100=XA

Output is two zero/one values. First indicates if the matrix is left-stochastic, second if it is right-stochastic.
Try it online! Or verify all test cases
s      % Implicitly input N×N matrix. Sum of each column. Gives a 1×N vector
G!     % Push input transposed
s      % Sum of each column. Gives a 1×N vector
v      % Concatenate vertically. Gives a 2×N matrix
!      % Transpose. N×2
100=   % Does each entry equal 100?
XA     % True for columns that contain only "true". Gives 1×2 vector. Implicitly display

Man that 100 was expensive, good answer though.

Mathematica, 46 43 bytes
AllTrue[#==100&]/@Apply[Plus,{#,#},{1}]&

As with other answers, the outputs are
{False, False} for non-stochastic
{True, False} for left-stochastic
{False, True} for right-stochastic
{True, True} for doubly stochastic
Saved 3 bytes by switching to the operator form of AllTrue

Use U+F3C7 (private use) for \[Transpose]

I considered it but thought that � was less enlightening

Also there's an extra @ at the end

C#, 205 203 183 bytes
Golfed:
int F(int[,]m){int x,i,j,r,c,e,w;x=m.GetLength(0);e=w=1;for(i=0;i<x;i++){r=c=0;for(j=0;j<x;j++){r+=m[i,j];c+=m[j,i];}if(r!=100)e=0;if(c!=100)w=0;}return e==1&&w==1?3:e==1?1:w==1?2:4;}

Ungolfed with comments:
    int F(int[,] m)
    {
        //x - matrix size
        //i, j - loop control variables
        //r, c - row/column sum
        //e, w - east/west, pseudo-bool values indicate right/left stochastic
        int x, i, j, r, c, e, w;
        x = m.GetLength(0);
        e = w = 1;

        for (i = 0; i < x; i++)
        {
            r = c = 0;

            for (j = 0; j < x; j++)
            {
                r += m[i, j];
                c += m[j, i];
            }

            if (r != 100)
                e = 0;

            if (c != 100)
                w = 0;
        }

        return e == 1 && w == 1 ? 3 : e == 1 ? 1 : w == 1 ? 2 : 4;
    }

Output key:
1 - right stochastic
2 - left stochastic
3 - double stochastic
4 - none
Try it: http://rextester.com/PKYS11433
EDIT1: r=0;c=0; => r=c=0;
EDIT2: Nested ternary operators. Credits goes to @Yodle.

if(e==1&&w==1)return 3;if(e==1)return 1;return w==1?2:4; Since e and w can only be 1 or 0, it can be changed to return w<<1|e; and redefine none==0.

You can shorten yours by 30 if you turn some of those if statements into ternary operations and just return an integer at the end.  Idunno if I should post my solution since it's so similar.

@LinkNg Very nice. I don't want to write code without understanding. I'm not familiar with binary operators.

@Yodle Thank you, I changed my solution. Feel free to post your even if it is very similar.

PHP, 104 bytes
function($a){for($s=array_sum;$a[+$i];)$o|=$s($a[+$i])!=100|($s(array_column($a,+$i++))!=100)*2;echo$o;}

An anonymous function that echos 0 => both, 1=> left, 2=> right, 3=> neither.
Use like:
php -r "$c=function($a){for($s=array_sum;$a[+$i];)$o|=$s($a[+$i])!=100|($s(array_column($a,+$i++))!=100)*2;echo$o;};$c(json_decode($argv[1]));" "[[4,8,15],[16,23,42],[80,69,43]]"

A command line program version at 114 bytes:
for($a=json_decode($argv[1]);$a[+$i];)$o|=($s=array_sum)($a[+$i])!=100|($s(array_column($a,+$i++))!=100)*2;echo$o;

Used like:
 php -r "for($a=json_decode($argv[1]);$a[+$i];)$o|=($s=array_sum)($a[+$i])!=100|($s(array_column($a,+$i++))!=100)*2;echo$o;" "[[4,8,15],[16,23,42],[80,69,43]]"

Python 2, 70 64 Bytes
Nothing crazy here, just making use of splatting in zip to transpose the matrix :) The outputs are as follows:
0 - not stochastic
1 - right stochastic
2 - left stochastic
3 - doubly stochastic

And here's the code :)
k=lambda m:all(sum(x)==100for x in m)
lambda n:k(n)+2*k(zip(*n))

Is the star in (*n a mistake?

@hhh No, that's the splat operator :) Essentially that's what is letting me transpose the matrix :)

JavaScript (ES6), 83 bytes
a=>[a.some(a=>a.reduce((l,r)=>l-r,100)),a.some((_,i)=>a.reduce((l,a)=>l-a[i],100))]

Just to be contrary, not only does this output the right stoachistic result on the left, but the booleans are also inverted, so an output of [false, true] still means right stoachistic.

C#6, 130 bytes
using System.Linq;bool[]F(int[][]a)=>new[]{a.Where((_,i)=>a.Select(x=>x[i]).Sum()==100).Count()==a.Length,a.All(x=>x.Sum()==100)};

{False, False} for non-stochastic
{True, False} for left-stochastic
{False, True} for right-stochastic
{True, True} for doubly stochastic
repl.it demo
Ungolfed
bool[]F(int[][]a)=>
    // Return new array of two bools. Array type is inferred from arguments
    new[]
    {
        // Left:
        // Count the no. of columns which sums up to 100
        a.Where((_,i)=>a.Select(x=>x[i]).Sum()==100).Count()
            // Then check if no. of such columns equal to total column count
            ==a.Length,
        // Right: Do all rows sum up to 100?
        // Can't use this trick for left because no overload of All() accept Func<TSource,int,bool> like Where() does
        a.All(x=>x.Sum()==100)
    };

Groovy, 57
{a={it.every{it.sum()==100}};[a(it),a(it.transpose())]}

Output
[0,0] if neither.
[1,0] if right.
[0,1] if left.
[1,1] if both.

Pip, 17 bytes
In an unexpected twist, this submission is a function.
{[h]=UQ$+_M[Zaa]}

Returns a list of two 0/1 values: [0 0] = not stochastic, [0 1] = left stochastic, [1 0] = right stochastic, [1 1] = doubly stochastic. Try it online!
Explanation
{               }  A function:
              a    Function argument (nested list)
           [Za ]   Create a list containing a's transpose and a
          M        Map this function to each of the above:
       $+_           Sum down the columns
     UQ              Get unique elements
 [h]=                If stochastic, the result should be [100]

Dyalog APL, 16 bytes
{∧/100=+/↑⍵(⍉⍵)}
{ } direct function definition (aka "dfn"), ⍵ is the argument
⍵(⍉⍵) the matrix alongside its transposition
↑ mix them into a single 2×n×n array
+/ sum along last axis, get a 2×n matrix
100= which elements are 100 (booleans are 0 1)
∧/ "and"-reduction along last axis, get 2 booleans for left,right stochastic

C++14, 139 136 133 130 bytes
-3 bytes for s=M.size(), -3 bytes for returning by reference parameter, -3 bytes as a unnamed lambda
[](auto M,int&r){int a,b,i,j,s=M.size();r=3;for(i=-1;++i<s;){for(j=-1,a=b=0;++j<s;a+=M[i][j],b+=M[j][i]);r&=(a==100)+2*(b==100);}}

Assumes input to be like vector<vector<int>>. Returns 3,2,1,0 for doubly, left, right, none stochastic.
Ungolfed:
auto f=
[](auto M, int& r){
  int a,b,i,j,s=M.size();
  r=3;
  for(i=-1;++i<s;){
    for(j=-1,a=b=0;++j<s;
      a+=M[i][j],
      b+=M[j][i]);
    r&=(a==100)+2*(b==100);
  }
}
;

Uiua, 14 12 bytes
/×=100/+∵⊟⍉.

Try it!
-2 thanks to Bubbler
Returns [0 0] for neither, [0 1] for left stochastic, [1 0] for right stochastic, and [1 1] for both.
/×=100/+∵⊟⍉.
           .  # duplicate
          ⍉   # transpose
        ∵⊟    # elementwise couple
      /+      # sum
  =100        # where is it equal to 100?
/×            # product

12 bytes: /×=100/+∵⊟⍉.

@Bubbler Fails for singleton arrays, unfortunately.

Singleton arrays should be input as [[100]], not [100].

@Bubbler Oops, my bad.

Jelly, 8 bytes
,Z§ạȷ2§¬

Try it online!
Outputs [1, 1] for doubly, [0, 1] for left, [1, 0] for right, and [0, 0] for neither.
,           Pair the input with
 Z          its transpose,
  §         sum the columns from each,
   ạ        take the absolute differences between each sum and
    ȷ2      1*10^2,
      §     sum each list of differences.
       ¬    Is each sum 0?

,Z§=ȷ2P€ is perhaps more intuitive.

source: Stack Exchange

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

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

sort: votes


text:
I really wanted a rhombus, but all I got was this stupid rectangle
Given only a straightedge and compass, inscribe a rhombus inside the given rectangle, sharing two opposite points.

Input
Input is the dimensions of the rectangle. In the example shown, that would be 125, 50. You can take input in whatever way is most convenient (as two integers, list, strings, etc).
The larger dimension will be 100 minimum, while the smaller will be 25 minimum. Both cap at 200.
Output
Output will be an image (displayed on screen or saved as a file) showing

The input rectangle
All "working" lines/circles
The inscribed rhombus

in distinct colors. In the image above, The rectangle is black, working lines blue, and rhombus orange. The lines should be drawn in the order shown in the list (eg rhombus overwrites working lines and rectangle).
The output image needs to be large enough to contain everything. For example, the circles shown cannot go out of bounds.
Method
The method used in the example image above is:

Draw a circle using the lower left corner as center, and the upper right as a point on the perimeter, giving a radius equal to the rectangle's diagonal.
Do the same, but swapping center and perimeter points.
Draw a line between the intersections of the two circles, giving a perpendicular bisector to the rectangle's diagonal.
Use the intersections of the new line and rectangle to draw the rhombus.

This works because the interior diagonals of a rhombus always perpendicularly bisect each other. I'm not including a full proof of this here, though.
This is not the only method to get your rhombus, and you can use another, given that you explain what you are doing. I believe it's probably the easiest, though.
Rules
You can only draw circles and lines (or rather, line segments). A circle is defined with a center point and perimeter point. A line is defined by any two points. Lines do not have to be any specified length, but they must at least cover the defining points (note the example image: the line goes a bit past the circle intersections, but not to the edge). For circles, the radius from center to the chosen perimeter point is considered a working line, and must be shown.
To rasterize the lines, you can use any recognized algorithm (e.g. Bresenham's), or rely on whatever builtins your language might have. If your output is vector-based, please ensure that it is show at a resolution at least as large as the input rectangle in pixels. Also, you'll be drawing on a plain canvas, so please suppress any grid marks or extraneous output.
No cheating! You can only determine placement of points/lines/circles using what you've established so far. If you can't explain how to use your working lines/circles to show it's a rhombus, you're doing it wrong.
You can use whichever pair of opposite points you want, and the rectangle does not need to be drawn axis-aligned, so long as the output is correct.
Input will always be a non-square rectangle, so don't worry about special-casing that.
Lastly, this is standard code golf, so lowest size in bytes wins.

Can we use a mathematical formula to decide, e.g., the endpoints of the line drawn between the circles' intersections once they've been drawn (without actually parsing the image to see where the intersections are)?

@ETHproductions I'd say yes, since it's fairly easy to show that the angle between them and the radius is 60 degrees on each side, and that they form equilateral triangles. If anyone has any objections, I'm willing to hear that also.

Can we assume that the first input will be greater than the second (or vice versa), or do answers have to be able to handle both vertically and horizontally oriented rectangles?

What is the purpose of the short line segment inside the rectangle?

HTML + JavaScript (ES6), 34 + 353 = 387 bytes
Input should be given in the format [125,50].

[w,h]=eval(prompt(c=C.getContext("2d"))).sort();d=q=>(c.strokeStyle=q,b);l=(x,y=Z)=>x?c.lineTo(x,y)||l:c.stroke();b=(x,y=H,r)=>(c.beginPath(),r?c.arc(x,y,Math.sqrt(r),0,2*Math.PI):c.moveTo(x,y),l);b(Z=300,Z)(W=Z+w)(W,H=Z+h)(Z,H)(Z)();d`red`(Z,H,s=w*w+h*h)();b(W,Z,s)();b(Z)(W)();b(Z+w/2-h,Z+h/2-w)(H+w/2,W+h/2)();d`lime`(Z)(W-s/2/w)(W)(Z+s/2/w,H)(Z,H)()
<canvas id=C width=800 height=800>

Just a lot of math and drawing... The rectangle is drawn sideways if the height is greater than the width, which I believe is allowed.

Oooh, 10 bytes less than 444 :P

@KritixiLithos Now I'm 10 bytes less than 400 ;-)

The rectangle becomes inscribed in the rhombus when the height is larger than the width.

@Larkeith Oops, didn't know we had to cover those cases. Fixed at the cost of 42 bytes.

You can use "getContext 2d " (without spaces) to save a few bytes (why did they have to use ` and break markdown...)

Mathematica, 157 148 158 bytes
Thanks to Martin Ender for comments with their usual high quality! 9 bytes saved in this case.
Edited once it was clarified that the arguments can come in either order; 10 bytes added to compensate.
Graphics@{(m=Line)@{o=0{,},{#,0},c={##},{0,#2},o},Blue,m[l={o,c}],Circle[#,(c.c)^.5]&/@l,m[{k={#2,-#},-k}+{c,c}/2],Red,m@{o,p={0,c.c/2/#2},c,c-p,o}}&@@Sort@#&

Again, this is where Mathematica shines: high-level graphics output involving mathematical computation. The same code with spaces and newlines for human readability:
Graphics@{
  (m=Line)@{o = 0{,}, {#, 0}, c = {##}, {0, #2}, o},
  Blue, m[l = {o, c}], Circle[#, (c.c)^.5] & /@ l,
  m[{k = {#2, -#}, -k} + {c, c}/2],
  Red, m@{o, p = {c.c/2/#2, 0}, c, c - p, o}
} & @@ Sort@# &

Unnamed function of a single argument which is an ordered pair of positive numbers; the final @@ Sort@# & converts that pair into two numerical arguments where the first number is the smaller. Line produces a polygonal path from point to point, which will turn into a closed polygon if the first and last points are the same; Circle produces a circle with given center and radius. Special points o and c (the lower-left and upper-right rectangle corners), p (a third rhombus corner, given by a mathematical formula), and k (helping to draw the perpendicular bisector) are given names along the way to save bytes when called again, as is the special pair of points l = {o,c}. Mathematica is happy to add points directly, multiply both coordinates by the same factor, take their dot product, etc., all of which simplify the code.
Sample output, with arguments 125 and 50:

Re unnecessary whitespace. You can use this trick to save a byte on {0,0}. Since there's no requirement to use blue and orange, you can save bytes by using Red instead of Orange. You're using Line four times which is more than enough to save bytes from i=Line; (as a rule of thumb, if the expression has n characters and you use it m times you need (m-1)*(n-1) > 4, less if you can assign the variable during first use without parentheses).

That 0{,} trick is fantastic :D

I'm afraid this doesn't work if the second side is longer than the first. However, the orientation doesn't need to be consistent, so this can be fixed by appending @@Sort@#& and swapping # and #2 throughout the code or alternatively adapting it to work with portrait-orientation rectangles instead.

Yes, that was intentional ... looks like we're awaiting clarification on whether we can assume the dimensions come in the order we want.

http://chat.stackexchange.com/transcript/message/33716642#33716642

MetaPost, 473 (with color) 353 (without color)
Colored (473 bytes):
A:=170;B:=100;pair X,Y;path C,D,E,F,G,R,T;X=(0,0);Y=(A,B);R=X--(A,0)--Y--(0,B)--cycle;T=(0,B)--(A,B);draw R;E=X--Y;C=X..Y*2..cycle;D=Y..-Y..cycle;F=(D intersectionpoint C)--(C intersectionpoint D);draw C withcolor green;draw D withcolor green;draw E withcolor red;draw F withcolor red;draw (F intersectionpoint R)--Y withcolor blue;draw X--(F intersectionpoint T) withcolor blue;draw (F intersectionpoint T)--Y withcolor blue;draw (F intersectionpoint R)--X withcolor blue;

Noncolored (353 bytes):
A:=170;B:=100;pair X,Y;path C,D,E,F,G,R,T;X=(0,0);Y=(A,B);R=X--(A,0)--Y--(0,B)--cycle;T=(0,B)--(A,B);draw R;E=X--Y;C=X..Y*2..cycle;D=Y..-Y..cycle;F=(D intersectionpoint C)--(C intersectionpoint D);draw C;draw D;draw E;draw F;draw (F intersectionpoint R)--Y;draw X--(F intersectionpoint T);draw (F intersectionpoint T)--Y;draw (F intersectionpoint R)--X;

Never EVER used this before, and I'm sure I butchered it...
But when you run that on this website:
http://www.tlhiv.org/mppreview/
It uses the intersection of the circles to draw the second axis, and then uses the intersection of the axis and the rectangle to draw the final rhombus. Though I could've cheated and just drawn a line perpendicular to the first axis haha.
To change the dimensions, just alter A and B.
Regardless, you end up with (for L=170, H=100):

Desmos, 375 (or 163) bytes
w=125
h=50
\left(wt,\left[0,h\right]\right)
\left(\left[0,w\right],ht\right)
\left(x-\left[0,w\right]\right)^2+\left(y-\left[0,h\right]\right)^2=w^2+h^2
\frac{h}{w}x\left\{0\le x\le w\right\}
-\frac{w}{h}\left(x-\frac{w}{2}\right)+\frac{h}{2}
a=\frac{h^2}{2w}+\frac{w}{2}
\left(t\left(w-a\right)+\left[0,1\right]a,ht\right)
\left(at-\left[0,a-w\right],\left[0,h\right]\right)

w and h are the inputs. Try it on Desmos!
Alternate 163-byte version:
w=125
h=50
(wt,[0,h])
([0,w],ht)
(x-[0,w])^2+(y-[0,h])^2=w^2+h^2
hx/w\left\{0\le x\le w\right\}
-w(x-w/2)/h+h/2
a=h^2/2/w+w/2
(t(w-a)+[0,1]a,ht)
(at-[0,a-w],[0,h])

This version requires each line to be copy and pasted into each separate line into Desmos. Meta still needs to decide if this is a valid counting method, but the former method is definitely fine.

This seems to assume that the input rectangle is in landscape orientation, which is not specified in the task.

To me, "the rectangle does not need to be drawn axis-aligned" implies that there's no predetermined orientation on the rectangle, including landscape vs. portrait, that needs to be preserved.

Since only size is given (not coordinates), the output may be aligned however you like, assuming size is correct.

First time I'm seeing Desmos being used as a golfing language :)

ImageMagick Version 7.0.3 + bash + sed, 496 bytes
M=magick
L=$((400-$(($1))/2)),$((400+$(($2))/2))
R=$((400+$(($1))/2)),$((400-$(($2))/2))
Z=" $L $R" Y=" -1 x";D=' -draw' K=' -stroke'
A=' -strokewidth 3 +antialias -fill'
$M xc:[800x]$A none$K \#000$D "rectangle$Z"$D "line$Z"$K \#00F8$D "circle$Z"$K \#0F08$D "circle $R $L" -depth 8 png:a
$M a txt:-|sed "/38C/!d;s/:.*//">x;P=`head$Y`;Q=`tail$Y`
$M a$A \#F008$K \#F008$D "line $P $Q" b
$M b txt:-|sed "/C70/!d;s/:.*//">x;S=`head$Y`;T=`tail$Y`
$M b$A \#F804$K \#F80$D "polyline $L $S $R $T $L" x:

Result with "rhombus.sh 180 120"

More precise (using 6400x6400 canvas instead of 800x800), 570 bytes
The intersections aren't exact; the "strokewidth" directive makes the lines wide enough to make sure at least one entire pixel gets mixed with just the colors of the two intersecting lines, but in the worst cases (25x200 and 200x25) the crossings are at a small angle so the cloud of mixed pixels is several pixels long, and since we select the first and last mixed pixel, there is a slight error.  Using an 8x larger canvas with the same strokewidth and then scaling the result down reduces the error to less than one pixel, but at about a 64x time penalty.
M=magick
L=$((3200-$(($1))*4)),$((3200+$(($2))*4))
R=$((3200+$(($1))*4)),$((3200-$(($2))*4))
K=-stroke;A='-strokewidth 3 +antialias'
$M xc:[6400x] $A -fill none $K \#000 -draw "rectangle $L $R" \
-draw "line $L $R" $K \#00F8 -draw "circle $L $R" \
$K \#0F08 -draw "circle $R $L" -depth 8 png:a
$M a txt:-|grep 38C077|sed -e "s/:.*//p">x
P=`head -1 x`;Q=`tail -1 x`
$M a $A -fill \#F008 $K \#F008 -draw "line $P $Q" png:b
$M b txt:-|grep C70000|sed -e "s/:.*//p">x
S=`head -1 x`;T=`tail -1 x`
$M b $A -fill \#F804 $K \#F80 -draw "polyline $L $S $R $T $L" -resize 800 x:

Results of normal 800x800 versus precise 6400x6400:

Ungolfed:
# rhombus.sh
# Inscribe a rhombus in the rectangle with dimensions 2*$1, 2*$2

# Run with "rhombus.sh W H"

M=magick

W=${1:-100};H=${2:-40}

# L locates the lower left corner of the rectangle
L=$((400-$((W))/2)),$((400+$((H))/2))

# R locates the upper right corner of the rectangle
R=$((400+$((W))/2)),$((400-$((H))/2))

# We'll need this several times
A='-strokewidth 3 +antialias'

# Establish 800x800 canvas (white) (circles + rectangle will
# always fit in 764x764)
#
# Draw the W x H rectangle (black) in center of canvas
#
# Draw two circles (blue, 50% alpha [#00F8] and green, 50% alpha [#0F08])
#  one centered at point L with peripheral point R
#  the other centered at point R with peripheral point L

$M xc:[800x] $A -fill none \
       -stroke \#000  -draw "rectangle $L $R" \
                      -draw "line      $L $R" \
       -stroke \#00F8 -draw "circle    $L $R" \
       -stroke \#0F08 -draw "circle    $R $L" \
       -depth 8 a.png

# Find P and Q, the 2 intersections of the circles,
# that have mixed color #38C077
$M a.png txt:-|grep 38C077|sed -e "s/:.*//p">x
P=`head -1 x`;Q=`tail -1 x`

# Draw line connecting the intersections P and Q
$M a.png $A -fill \#F008 -stroke \#F008 -draw "line $P $Q" b.png

# Find S and T, the 2 intersections of the line with the original rectangle,
# that have mixed color #C70000
$M b.png txt:-|grep C70000|sed -e "s/:.*//p">x
S=`head -1 x`;T=`tail -1 x`

# Draw the rhombus
$M b.png $A -fill \#F804 -stroke \#F80 -draw "polyline $L $S $R $T $L" d.png

I like the way you detect the intersections, very nice. Is the last mixed color correct? I ask because it looks like the rhombus and rectangle lines are slightly off. I thought maybe the color was being detected in a slightly off spot due to anti-aliasing (possibly stroke width also).

LibreLogo, 270 bytes

User input is taken as an array: [width, height] or [height, width].

Code:
fc [24]
D=180
R=sorted(eval(input "))
W=R[1]
H=R[0]
L=sqrt W**2+H**2
A=D/π*asin(H/L)
Z=A*2
S=L/2/cos A*π/D rectangle[W,H]pc 255 lt A fd 400 bk 800 fd 400 rt A pu bk H/2 lt 90 fd W/2 pd circle L*2 rt D-A fd L circle L*2 pc [5]lt D-A fd S lt Z fd S rt D+Z fd S lt Z fd S

Result:

Explanation:
fc [24]                        ; Fill Color = Invisible
D = 180                        ; D = 180° (Saved Bytes)
R = sorted( eval( input " ) )  ; R = Sorted Array of Rectangle Width and Height (User Input)
W = R[1]                       ; W = Rectangle Width
H = R[0]                       ; H = Rectangle Height
L = sqrt W**2 + H**2           ; L = Rectangle Diagonal Length
A = D / π * asin( H / L )      ; A = Rectangle Diagonal Angle°
Z = A * 2                      ; Z = Rectangle Diagonal Angle° * 2 (Saved Bytes)
S = L / 2 / cos A * π / D      ; S = Rhombus Side Length
rectangle [W, H]               ; Draw Rectangle
pc 255                         ; Pen Color = Blue
lt A                           ; Left = Rectangle Diagonal Angle°
fd 400                         ; Forward = 400 pt
bk 800                         ; Back = 800 pt
fd 400                         ; Forward = 400 pt
rt A                           ; Right = Rectangle Diagonal Angle°
pu                             ; Pen Up
bk H / 2                       ; Back = Rectangle Height / 2
lt 90                          ; Left = 90°
fd W / 2                       ; Forward = Rectangle Width / 2
pd                             ; Pen Down
circle L * 2                   ; Draw Left Circle (Radius = Rectangle Diagonal Length)
rt D - A                       ; Right = 180° - Rectangle Diagonal Angle°
fd L                           ; Forward = Rectangle Diagonal Length
circle L * 2                   ; Draw Right Circle (Radius = Rectangle Diagonal Length)
pc [5]                         ; Pen Color = Red
lt D - A                       ; Left = 180° - Rectangle Diagonal Angle°
fd S                           ; Forward = Rhombus Side Length
lt Z                           ; Left = Rectangle Diagonal Angle° * 2
fd S                           ; Forward = Rhombus Side Length
rt D + Z                       ; Right = 180° + Rectangle Diagonal Angle° * 2
fd S                           ; Forward = Rhombus Side Length
lt Z                           ; Left = Rectangle Diagonal Angle° * 2
fd S                           ; Forward = Rhombus Side Length

R, 290 bytes
function(A,B,p=polygon){R=A^2+B^2
D=2*A
a=sqrt(R)*cbind(cos(t<-seq(0,2*pi,.01)),sin(t))
b=t(t(a)+c(A,B))
x=range(a,b)
plot(NA,xli=x,yli=x,as=1,ax=F,an=F)
rect(0,0,A,B)
segments(0,0,A,B,c=4)
p(a,b=4)
p(b,b=4)
curve(B/2-A*x/B+A^2/2/B,co=4,a=T)
p(cbind(c((R-2*B^2)/D,A,R/D,0),c(B,B,0,0)),b=3)}

Anonymous function, output is displayed on screen.
Slightly ungolfed, with comments:
function(A,B){
    R=A^2+B^2
    D=2*A
    t=seq(0,2*pi,.01)
    a=sqrt(R)*cbind(cos(t),sin(t)) #Circle with (0,0) as center
    b=t(t(a)+c(A,B)) #Second circle transposed to (A,B) center
    x=range(a,b)
    #Empty plot, large enough to fit the 2 circles:
    plot(NA,xlim=x,ylim=x,asp=1,axes=F,ann=F)
    rect(0,0,A,B) #Initial rectangle
    segments(0,0,A,B,col=4) #Rectangle diagonal
    polygon(a,border=4) #Circle 1 (border is b thanks to partial matching)
    polygon(b,border=4) #Circle 2
    curve(B/2-A*x/B+A^2/2/B,col=4,add=T) #Line joining circles intersection
    polygon(cbind(c((R-2*B^2)/D,A,R/D,0),c(B,B,0,0)),border=3) #Rhombus
}

Example output for (120,100):

Python 3.5 + Tkinter, 433 or 515 bytes
Non-Colored (433 bytes):
from tkinter import*
def V(a,b):S=500;Y,Z=S+a,S-b;M=(a**2+b**2)**0.5;D=Tk();C=Canvas(D);B=C.create_oval;X=C.create_line;B(S+M,S-M,S-M,S+M);B(Y-M,Z+M,Y+M,Z-M);X(Y,Z,S,S);C.create_rectangle(Y,S,S,Z);Q=-((Z-S)/(Y-S))**-1;U,V=(Y+S)/2,(Z+S)/2;X(U+M,V+M*Q,U-M,V-M*Q);P=[(Y,Q*(Y-U)+V),(((Z-V)/Q)+U,Z)][a>b];L=[(S,Q*(S-U)+V),(((S-V)/Q)+U,S)][a>b];X(S,S,P[0],P[1]);X(Y,Z,P[0],P[1]);X(Y,Z,L[0],L[1]);X(S,S,L[0],L[1]);C.pack(fill=BOTH,expand=1)

Colored (515 bytes):
from tkinter import*
def V(a,b):S=500;t='blue';Y,Z=S+a,S-b;M=(a**2+b**2)**0.5;D=Tk();C=Canvas(D);B=C.create_oval;X=C.create_line;B(S+M,S-M,S-M,S+M,outline=t);B(Y-M,Z+M,Y+M,Z-M,outline=t);X(Y,Z,S,S,fill=t);C.create_rectangle(Y,S,S,Z);Q=-((Z-S)/(Y-S))**-1;U,V=(Y+S)/2,(Z+S)/2;X(U+M,V+M*Q,U-M,V-M*Q,fill=t);P=[(Y,Q*(Y-U)+V),(((Z-V)/Q)+U,Z)][a>b];L=[(S,Q*(S-U)+V),(((S-V)/Q)+U,S)][a>b];o='orange';X(S,S,P[0],P[1],fill=o);X(Y,Z,P[0],P[1],fill=o);X(Y,Z,L[0],L[1],fill=o);X(S,S,L[0],L[1],fill=o);C.pack(fill=BOTH,expand=1)

A named function that takes input as 2 comma-separated numbers. The output is given in a separate window that you may have to resize to see the full output. Here is a sample colored output for V(180,130):

SmileBASIC, 280 bytes
INPUT W,H
W=MAX(W,H)/4H=MIN(W,H)/4D=SQR(W*W+H*H)N=D+W
M+D+H
GBOX D,D,N,M,#RED
GCIRCLE D,M,D
GCIRCLE N,D,D
GLINE D,M,N,D
X=D+W/2Y=D+H/2A=ATAN(W,H)E=D*H/W/2S=E*COS(A)T=E*SIN(A)GLINE X-S*9,Y-T*9,X+S*9,Y+T*9GCOLOR-#L
GLINE D,M,X-S,Y-T
GLINE D,M,X+S,M
GLINE N,D,X+S,Y+T
GLINE N,D,X-S,D

(Screenshot/explanation will be posted soon)
Background color is black, rectangle is red, circles and lines are white, and the rhombus is yellow.

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


text:
Draw the Hilbert Curve
A Hilbert Curve is a type of space-filling curve, and it basically maps a line to a plane. Each point in the line corresponds to just one point in the plane, and each point in the plane corresponds to just one point on the line. Shown are iterations 0 through 4 of the Hilbert Curve:
Iterations 0 up to 4:

The objective of this task: Write code that draws the fourth iteration of the Hilbert Curve, as defined above. Your code should be complete - in other words, if you create a function to draw the Hilbert Curve, your code must call that function. The output can either be displayed directly on the screen, or you can write the output to an image file. The curve may be rotated or flipped, but lines must intersect at right angles and the output cannot be stretched. ASCII art is appreciated but will not be accepted. Shortest code in bytes wins!

Is the number of times an input? Or can we choose any value at least 4?

Is ASCII art considered graphical?

No; sorry - then it'd be a duplicate of another question

@JorgePerez Can the curve have a different orientation? Like a vertically flipped or 90-deg rotate version of your examples

Yes! Although the overall shape must still be square

MATL, 39 38 bytes
O5:"tZjJ*JQ-wJq+t2+&y2j+_v2/]XG25Y01ZG

This takes the number of iterations as input. If you want to hard-code it, replace i by the number.
The program is a port of the Matlab code by Jonas Lundgren shown here.
The result is shown below. You can also try it at MATL Online! It takes a couple of seconds to produce the output. This compiler is experimental; you may need to refresh the page and press "Run" again if it doesn't initially work.

Explanation
O          % Push 0. This is the initial value of "z" in the original code
5:"        % Do 5 times
  t        %   Duplicate
  Zj       %   Complex conjugate
  J*       %   Multiply by 1j (imaginary unit). This is "w" in the original code
  JQ-      %   Subtract 1+1j
  w        %   Swap: brings copy of "z" to top
  Jq+      %   Add 1-1j
  t        %   Duplicate
  2+       %   Add 2
  &y       %   Duplicate the third element from top
  2j+_     %   Add 2j and negate
  v        %   Concatenate the three matrices vertically
  2/       %   Divide by 2
]          % End
XG         % Plot (in complex plane). The numbers are joined by straight lines
25Y0       % Push string 'square'
1ZG        % Make axis square

Could you explain how your code works?

The algorithm is exactly as in the link. But I will add an explanation

@Jorge Explanation added

omg, the one you based yours of is so much easier than mine =/

@flawr All credit to Jonas Lundgren :-)

@LuisMendo I used his approach now for the sierpinsky arrowhead perhaps you can still use that one again to port it to MATL :)

MATLAB, 264 262 161 bytes
This works still very much the same, except that we basically calculate the "derivative" of the hilbert curve, that we then "integrate" via cumsum. This reduces the code size by quite a bunch of bytes.
function c;plot(cumsum([0,h(1,1+i,4)]));axis equal;end function v=h(f,d,l);v=d*[i*f,1,-i*f];if l;l=l-1;D=i*d*f;w=h(f,d,l);x=h(-f,D,l);v=[x,D,w,d,w,-D,-x];end;end

Old version
This is just a plain recursive approach. I used complex numbers to store vectorial information for simplicity. You can change the curve at the part h(0,1,1+i,4). The first argument p=0 is the initial position, the second argument f is a flag for the orientation (+1 or -1), the third argument d is the direction/rotation in which the curve should be drawn and the fourth one l is the recursion depth.
function c;hold on;h(0,1,1+i,4);axis equal;end function p=h(p,f,d,l);q=@plot;if l;l=l-1;d=i*d*f;p=h(p,-f,d,l);q(p+[0,d]);p=p+d;d=-i*d*f;p=h(p,f,d,l);q(p+[0,d]);p=p+d;p=h(p,f,d,l);d=-i*d*f;q(p+[0,d]);p=p+d;p=h(p,-f,d,l);else;q(p + d*[0,i*f,1+i*f,1]);p=p+d;end;end

This is what it looks like in older versions:

This is what it looks like in 2015b:

-->

In Matlab R2015b it plots in colors <3

Haha so cool :)

@LuisMendo I was now able to golf it a bit with the cumsum idea which is just brilliant!

Starting from Matlab 2016b you can define functions in scripts. This can save you a few more bytes so you're down to 144. (Note that to make this work on TIO I had to move the definition of h to the first line. In Matlab this would have to be the last line of the script).

R, 90 bytes
n=scan();a=1+1i;b=1-1i;z=0;for(k in 1:n)z=c((w<-1i*Conj(z))-a,z-b,z+a,b-w)/2;plot(z,t="s")

Shameless R-port of the the algorithm used in the link posted by @Luis Mendo.
For n=5 we get:

JavaScript (ES6), 266 ... 233 232 bytes
A SVG rendering of the Hilbert Curve.

document.write('<svg><path fill=none stroke=red d="M8 8'+(f=(i,s='2',d=x=y=8)=>i?f(i-1,s.replace(/./g,c=>[32410401423,,10432423401][+c]||c)):s.replace(/./g,c=>c-4?(d+=c&1&&c-2,''):`L${x+=4-'4840'[d&=3]} ${y+=4-'0484'[d]}`))(5)+'">')

Saved 1 byte thanks to Neil

Try fill=none

MATLAB/Octave, 202 bytes
I noticed the version @LuisMendo linked is was way shorter than previous "handmade" solution but uses an entirely different approach. I'm posting a golfed version here now as a CW:
This version is based on the Lindenmayer system approach:
A=zeros(0,2);B=A;C=A;D=A;n=[0,1];e=[1,0];for k=1:4;a=[B;n;A;e;A;-n;C];b=[A;e;B;n;B;-e;D];c=[D;-e;C;-n;C;e;A];D=[C;-n;D;-e;D;n;B];A=a;B=b;C=c;end;A=[0,0;cumsum(A)];plot(A(:,1),A(:,2));axis off;axis equal

Python 3, 177 175 171 bytes
A simple implementation of the Lindenmayer system for the Hilbert curve. Golfing suggestions welcome!
Edit: -2 bytes thanks to Kade. -3 bytes from restructuring how the Hilbert curve is built. -1 byte with thanks to ETHproductions.
from turtle import*;s="a";exec('t=""\nfor c in s:t+=c>"F"and"+-abFF-+baFFba-+FFab+-"[c<"b"::2]or c\ns=t;'*5)
for c in s:
 if"-">c:rt(90)
 elif"F">c:lt(90)
 elif"a">c:fd(9)

Ungolfing
import turtle

hilbert_seq = "a"

for _ in range(5):
    new_seq = ""
    for char in hilbert_seq:
        if char == "a":
            new_seq += "-bF+aFa+Fb-"
        elif char == "b":
            new_seq += "+aF-bFb-Fa+"
        else:
            new_seq += char
    hilbert_seq = new_seq

for char in hilbert_seq:
    if char == "F":
        turtle.forward(9)
    elif char == "+":
        turtle.right(90)
    elif char == "-":
        turtle.left(90)

Changing how you form t can save two bytes: t+=[[c,"+AF-BFB-FA+"][c=="B"],"-BF+AFA+FB-"][c=="A"]. Since the pattern is almost the same for the two of them I wonder if there's some way to use that..

Perhaps change if c>"E": to if"E"<c: to save a byte?

Mathematica (Wolfram Language) 76 bytes
After Mathematica 11.1, there is a HilbertCurve function, but i don't want to use it
Region@Line@ReIm@Nest[Join[w=I Conjugate@#-1-I,t=#+I-1,t+2,-2I-w]/2&,{0},#]&

MSWLogo (Version 6.5b), 136 bytes
Based on the final Hilbert curve program here.
to h :n :a :l
if :n=0[stop]
rt :a
h :n-1(-:a):l
fd :l
lt :a
h :n-1 :a :l
fd :l
h :n-1 :a :l
lt :a
fd :l
h :n-1(-:a):l
rt :a
end
h 5 90 9

A function h is defined, which takes number of iterations :n (1-based), angle :a, length :l. It is recursive, calling a lower iteration of itself with the angle :a negated in two instances to get the orientation correct.

rt :a, lt :a rotate the turtle (triangle thingy whose path is traced) right, left by :a degrees.
fd :l moves the turtle forward by :l steps.

Finally, the function is called: h 5 90 9. The turtle can be hidden for an extra 2 bytes, ht.

What's happening on the top left corner?

@flawr That's the turtle. It can be hidden by appending ht.

Mathematica 128 Bytes
Graphics[Line@AnglePath[Total/@Split[Cases[Nest[#/.{-2->(s=##&@@#&)[l={-1,2,0,1,-2,0,-2,1,0,2,-1}],2->s@-l}&,{-2},4],-1|1|0],#!=0&][[;;-2,;;-2]]*Pi/2]]

Replace the 4 above with a different number of iterations if you like.
Done as a Lindenmayer system with integer sequences rather than string sequences so the second production rule is just the negative of the first rule. This version is 151 bytes.
The port of Jonas Lundgren's MATLAB code is only 128 bytes.
z=0;Graphics[Line[{Re[#],Im[#]}&/@Flatten[Table[w=I*Conjugate[z];z={w-(a=1+I),z-(b=1-I),z+a,b-w}/2,{k,5}][[5]]]],AspectRatio->1]

I see that in a future version of Mathematica, this may become really short, something like:
Graphics@HilbertCurve[n]

http://mathworld.wolfram.com/HilbertCurve.html

LindenMASM, 63 Bytes
Another question with a LindenMASM answer? Awesome!
STT
AXI A
INC 5
SET F 0
RPL A -BF+AFA+FB-
RPL B +AF-BFB-FA+
END

Once again, due to some drawing bugs with Python's turtle, sometimes when you run this the whole drawing isn't there. However you can see it does actually work:


text:
Draw the Serpinski Triangle
For today's fractal challenge, draw at least 5 iterations of Sierpinski's triangle! (Shown below is Sierpinski's trinagle)

The resolution of the image must be sufficent that the smallest triangles are at least one pixel in size, and all triangles should be approximately equillateral - pixel art that draws a right-triangle variant will be appreciated, but not accepted. Shortest code in bytes wins!


text:
PPCG Jeopardy: Cops
How well do you know the site?  Let's find out.
This is a cops-and-robbers challenge.  Robber's thread.
As a cop, you need to:

Find a non-deleted, non-closed challenge on this site to answer.  The challenge cannot have the following tags: cops-and-robbers, popularity-contest, code-trolling, underhanded, busy-beaver, king-of-the-hill, tips, answer-chaining.  The challenge must have restrictions on valid output.
Write a valid submission for the challenge, in a free language found on Wikipedia or esolangs.org or tryitonline.  The submission does not have to be competitive, only valid. EDIT: Hashing in your submission is not allowed
Post the submission here, keeping the challenge secret.  You must post the entire submission, as well as the language (and version, if applicable).

After a week, if nobody has found the challenge you are answering, you may post the challenge that your submission is answering, at which point, your submission is safe.  It is worth N points, where N is the number of upvotes on the challenge (as of 2016-11-17) (Higher is better)
To crack your challenge, a robbers need to find any challenge that the submission is a valid submission for.
Notes:

If a challenge requires an output of X, and you output XY or YX where Y is anything besides whitespace, the submission is not valid for that challenge.
A challenge newer than 2016-11-17 is not allowed.
Languages newer than the hidden challenge are allowed.
I reserve the right to ban certain challenges if they are widely applicable (could be applied to the majority of all submissions).
Thanks to Daniel for the initial idea!

Here's a search query for valid questions.
Uncracked Submissions:

Are cops required to provide any information about the nature of the code's expected input? (e.g. a lot of input might be invalid and cause the code to crash)

No, the cops only need to provide the code + language.

Related meta post

What are the rules about languages which are newer than the challenge? Are they disallowed due to being newer than this challenge, or newer than the hidden challenge?

Languages newer than the hidden challenge are allowed.

Any limit as to how many submissions per user, or per user and language?

Is the byte count we report in this challenge the total number of bytes, or based on the scoring of the challenge we're posting for (i.e. if the challenge offered a % count reduction, would we apply that for our answers here?)

Byte counts are not required.

nathan may make it so that any challenge which the program provides valid IOs for is an acceptable crack?

@tuskiomi if I understand you, any challenge that the program provides valid input/output for is a valid crack.

Within an hour on which computer?

There are many challenges where solutions will take much longer than an hour to compute for valid inputs. The time limit is not a good idea.

Rather than trying to indirectly prevent the impossible hash answers with the time limit, i think you should just directly ban hashing...

I disagree. There are lots of other ways to get around hashing (unscramble and eval).  I prefer the time limit. If the challenge can't be solved in under an hour, then that's an unfortunate side effect

@NathanMerrill The current phrasing suggests that if there exists an input that will take an hour to compute the result for, the answer is not valid. This means basically every non-trivial challenge.

Obligatory link to the Things to Avoid post.

I don't understand the urgency to ban cryptographic hashes since they are unlikely to be useful to cops.

Counterexample: generate every possible program until you generate one that matches a hash. Run it.

@NathanMerrill Not feersum here, but as I've commented on Mego's submission, there's no guarantee you won't hit another hash collision before the intended one. I believe cops should have to be certain that their program is indeed the first one that matches, in which case if the cop can verify it then robbers can too.

@NathanMerrill That does NOT work. Collision avoidance of cryptographic hashes is based on probability, not magic.

@feersum why not?

Sp already explained it.

Having said that, other forms of cryptography might be problematic, e.g. semiprime factorisation which is a problem most CnRs have (just a side note).

We need a PPCG-introspection tag :-)

I'm a bit unsure about the rules regarding single value outputs... Would a challenge asking for the number of letters in a string be disallowed, since the output is a single number? What about finding the n'th prime? What about challenges asking for true/false?

The key here is that they allow any numerical output for any input (aka, it doesn't matter what number you print, it's valid)

That said, it was simply a reiteration of the clearer requirement: The challenge must have restrictions on valid output. I removed it in interest of clarity

Total score 348. What was the winning criteria?

Pip, 9 bytes (safe, 15 points)
(q`\w+`1)

What it does should be easy to figure out, but the question is why... (TIO)

The challenge was What's the Language? The goal: parse the name of the programming language out of a PPCG answer header. For instance:
Input:
JavaScript, 13 chars / 32 bytes

Desired Output: JavaScript

I'm not sure whether this falls afoul of "The challenge must have restrictions on valid output," since it's a test-battery challenge scored by "percent of tests you get correct," and thus doesn't require the output to be correct for all input. However, I will say that the code above gets about a 60% correct rate, which isn't bad for something so simple.

seems like it's splitting a string on commas and returning the 2nd string in the resulting split O_O I don't know pip, but that's all I got so far.

@Yodle splitting it into regex words, not just into commas

Translated into pyth I believe this is something like ht:w"\w+"1 / @:w"\w+"1 1, which minifies to htcw / htcz if only whitespace matters, but none of those turn up any results. Also this would be able to pull out minutes from HH:mm:ss format, or extract a variable name from a C-style declaration, or numbers after a decimal point. But I can't find questions which ask for any of those things... :/

Perl - Cracked by DLosc
Let's give an easy one for the non-esolang people
Run with -nl
say $_ ~~ reverse y-"({[]})"-")}][{("-r;;r-")}][{("-"({[]})"-y esrever ~~ _$ yas

Challenge: Convenient Palindrome Checker
The code crashes after printing the truthiness, but according to this meta post, as long as it produces the correct output before it crashes, and any errors are output to STDERR, it's a valid solution.

As if Perl is easier to read than an esolang :P

Yeah I don't know any esolangs, but I also don't know Perl :(

Cracked

Dangit, I was going to post that exact thing until the post was deleted earlier (I also couldn't figure out how to get it to run on ideone)

For any future entries, I'll submit an ideone link with an explanation of how to run it.

Perl, 56 bytes, Safe (14 points)
undef$/;print+(<>^<>)=~y/\x81-\xff\x00-\x80/\x01-\xff/dr

The challenge was this one, requiring you to create a diffing algorithm; you need to be able to input two files and output a diff, or input a file and a diff and output the other file. The scoring of that challenge is code-challenge, making the smallest diff the winner; however, this challenge doesn't require the answer to be competitive, simply compliant with the spec, so I wrote a diffing program in a golfed way instead, which simply uses XOR to combine the inputs (meaning that the same program works for diffing and un-diffing).
The hardest part is reproducing the length of the original files. The input is specified as ASCII, which is a seven-bit character set, thus allowing me to use the eighth bit to track the length of the file. When diffing, we set the high bit of every byte using a y/// instruction (which is slightly more obfuscated than bitwise arithmetic would be). When un-diffing (recognised via noting that the input already has the high bit set), we remove NULs from the output. (I've just realised that this would fail if the input contained NUL bytes; however, the challenge is defined in terms of a test battery, and luckily I don't think there are NUL bytes in the battery. If there are, then this program would be incorrect and would need to be disqualified; a problem with a cops-and-robbers is that nobody else has enough information to point out easily fixed flaws in your answer!)

Safe, methinks.

Perl, safe, 18 points
Edit : I modified the end of the code (see the edit history) to handle an edge case (the challenge doesn't say anything about it, and the author did not answer when asked about it, but at least this code handles it). But the algorithm and the logic of the code remain the same.
perl -n0E '/.*/;s/(^0|A)(.{@{+}})?0/A$2A/s||s/0(.{@{+}})?A/A$1A/s?redo:say/A$/+0'

This code isn't obfuscated (just golfed). (This implies that -n0E aren't optional).
I don't realize whether this is hard or not, but I guess I'll be fixed when someone cracks it.

Explanations:
The challenge was Can maze be solved?.
This code will find every reachable cell of the maze (and mark them with a A): if a cell touches a cell marked with a A, the it's reachable and we mark it with a A too; and we do that again (redo). That's done thanks to two regex: s/(^0|A)(.{@{+}})?0/A$2A/s checks if a space is on the right or the bottom of a A, while s/0(.{@{+}})?A/A$1A/s checks if a space is on the left or on top of a A. At the end, if the last cell contains a A it's reachable, otherwise it's not (that's what say/A$/+0 checks; the +0 is here to make sure the result will be 0 or 1 instead of empty string and 1).
Note that /.*/ will match an entire line, thus setting @+ to the index of the end of the first line, which happens to be the size of a line, which allow use to use .{@{+}} to match exactly as many character as there are on a line. (@{+} is equivalent to @+, but only the former can be used in regex)
To run it:
$ perl -n0E '/.*/;s/(^0|A)(.{@{+}})?0/A$2A/s||s/0(.{@{+}})?A/A$1A/s?redo:say 1-/0$/' <<< "0000001
0000010
1111011
0000000"
1

(and if you replace the 1111011 line with 1111111, the it's not solvable anymore, and the output will be 0 instead of 1)

Octave, 15 points! SAFE
@(x,y)find((v=((z=cumsum(x.^2))(y:end)-[0,z(1:end-y)]))==max(v),1)-1

Try it online here.

Explanation:
The code takes an input string x containing ones and zeros, 10010110110101 and an integer y.
To find the moving average of a sequence in MATLAB/Octave you can do:
z = cumsum(x);
movmean = z(y:end) - [0 z(1:end-y)];

Since we're only interested in the location of the maximum, not the actual values, we don't need to care about converting the string to numbers. (x.^2) squares all the ASCII-values 48,49 for 0,1. This is necessary since Octave can't use cumsum directly on characters. cumsum(+x) would be two bytes shorter but would reveal that x is a string.
This is actually quite well golfed (except for the .^2 instead of +). Of course, convolution would be simpler.

Hexagony, 548 bytes, Cracked
69;{108;\_1$;;;/0;108\56;19|1^\6/15\;72_$23371<};;!;6;33|;;015><;;7;@3?;43+1586;2_3219><11;;'_8;;;2_|3;81|2<|8517;327}1_23;1;4$%;_4{5.1;1332_3;029&;'_};;1..527;2'..35;5212_>97;$;2/0;-;3_2;/233;08.._\901;0/13'}92...>/>/57\53;633;4'22;/|~>;441;45;;$161;371;3/;3.7026;`208;1<}>27;140;217;11.0;/2;692;<01/2;301;18;31/;10;/3;44<1914/111;{98;38;;;13/4;<;3;1;;/;112;<.$13032;..27;1;222/1;0<6..1;0;'..933721389/9<6;.;3;37..;;875;*;;0[1;287]59..902;;2;12;1;59;;3#..4;;1=249$345249;...;012}021#>/;44>114/4201;;;3>0;>;24;3/;;116._4>337;237/$5_>1{32;102;255;'_

Try it online!

This challenge is probably not the one you intended, because the output here changes depending on an input number. But without input it prints the string in that challenge, and "robbers need to find any challenge that the submission is a valid submission for". So, cracked?

@LuisMendo it doesn't quite print that string.

(Just to be clear, my answer doesn't print the trailing . required by that challenge.)

Yes, I saw :-) My knowledge of Hexagony didn't allow me to progress much...

Cracked.

@StewieGriffin Nice job. :)

05AB1E, 27 bytes, cracked!
For this submission, input is also required for it to work. Shouldn't be too hard to crack.
ávyl•B;£¡´•54B•2ît•‡y.li(}O

Explanation (for the challenge):
á                             # Keep all the letters of the input string
 vy                           # For each letter...
   l                          #   Convert to lowercase
    •B;£¡´•54B                #   String that turns into 'pnbrqk'
              •2ît•           #   Compressed int: 133591
                   ‡          #   Transliterates the following:
                                    p -> 1
                                    n -> 3
                                    b -> 3
                                    r -> 5
                                    q -> 9
                                    k -> 1
                    y.li }    #   If the current letter is lowercase...
                        (     #     Negate that number
                          O   # Sum up the result

Uses the CP-1252 encoding. Try it online!

you post to pastebin?: http://pastebin.com/QyvpUb9b

@tuskiomi Hmm, nope that wasn't me.

that's strange. I googled your result (you gotta make sure) and that was 1 of 3 results. I wonder there is a bot that's pulling answers?? hmm..

Prints the second input

@Oliver not exactly, zyxwvut tuvwxyz doesn't produce an output...

cracked?

@Maltysen Yep, that was the one! Nice :).

MATL. Cracked
&:"@FYAYm7>vs

Try it online!
I indicated input and output even if it's not necessary. Since it's in the edit history anyway: the program inputs two numbers and outputs one number.

Cracked :-)

@ETHproductions Oh, how did you find that challenge? I picked it literally randomly .-)

C#, 590 bytes, Cracked
(I,N)=>{string R="",p="`1234567890-=",P="~!@#$%^&*()_+",q="qwertyuiop[]\\",Q="QWERTYUIOP{}|",a="asdfghjkl;\'",A="ASDFGHJKL:\"",z="zxcvbnm,./",Z="ZXCVBNM<>?";foreach(var c in I){var f=c+"";if(p.Contains(f))R+=p[(p.IndexOf(c)+N)%13];else if(P.Contains(f))R+=P[(P.IndexOf(c)+N)%13];else if(q.Contains(f))R+=q[(q.IndexOf(c)+N)%13];else if(Q.Contains(f))R+=Q[(Q.IndexOf(c)+N)%13];else if(a.Contains(f))R+=a[(a.IndexOf(c)+N)%11];else if(A.Contains(f))R+=A[(A.IndexOf(c)+N)%11];else if(z.Contains(f))R+=z[(z.IndexOf(c)+N)%10];else if(Z.Contains(f))R+=Z[(Z.IndexOf(c)+N)%10];else R+=c;}return R;};

Probably pretty easy, also a fairly long program ,_,

Lambda is Func<string, int, string>. Looks like it's some keyboard cipher. The number param is how many chars to shift right on the keyboard (ie- ("t",1) = y).

Cracked

Nice, wasn't expecting that to last too long :P

MATL. Safe, 93 points
dP7EGn:q^1J2/h)ts_hX=Gs[BE]Wd=~>~GBz*

Try it online!

Explanation
The challenge was Source code ecological footprint.
The code computes the Hamming weight (number of ones) in the binary representation of the ASCII codes of the input string; except that the string test outputs 0 (instead of its Hamming weight, which is 17).
The special-casing of that string is a little obfuscated. The program first computes the array of consecutive differences of the ASCII codes of the input and reverses it. For test this gives [1 14 -15].
Then, the array formed by the first n powers of 14 is computed ([1 14 196 ...]), where n is input length; and the first floor(n/2) values are kept. So for input test this gives [1 14]. The negated sum is appended to this array, which gives [1 14 -15] for input test. This is tested for equality with the reversed array of consecutive differences which was previously obtained.
On the other hand, the sum of the ASCII codes of input chars is computed and compared with 448, generated as the (consecutive) difference of the elements in the array [2^6 2^9] (where ^ denotes power).
The input test is the only string with reversed consecutive differences of the form [1 14 -15] and sum 448. Differences [] or [1] (for shorter inoyt strings) are not compatible with a total sum of 448. Differences [1 14 196] or larger cannot be achieved with ASCII characters.
The code checks if the result of the test for the first condition (consecutive differences) is not smaller than the negated result of the second condition (total sum). This gives 0 if and only if both conditions were satisfied. Finally, this is multiplied by the number of ones in the binary representation of the ASCII codes of the input.

Try it Online please.

@tuskiomi Done. But since you have to guess the input format, it's not much use...

Numbers seem to work well.

Cracked!

@boboquack Not quite :-) My code's output is not the Hamming distance of an input (although that may be the case for the inputs you have tried)

In my answer, it had the Hamming weight of the input, not the distance. If your answer doesn't calculate that, or doesn't calculate the number of set bits (the same thing), could you please give me a counterexample so that I can continue trying to crack it?

@boboquack I'm not sure what I could say without giving too much of a hint...

This might be a winner... :)

아희(Aheui), 0 bytes, Cracked

Try it here! (The program is already typed in for you :p )

Cracked

@milk Wow! That was quick!

CJam (safe, 21 points)
{W+W%~1{1$)}{)a1${\(+W%{1$1$-2=>}{+}w}{\;}?)_@*\+~}w+}

This is an anonymous block (function).

Python, 935 Bytes
def oo000 ( num ) :
 return - ~ num
def ii ( num ) :
 return - ( oo000 ( oo000 ( ~ num ) ) )
def oOOo ( num1 , num2 ) :
 while num2 > 0 :
  num1 = oo000 ( num1 )
  num2 = ii ( num2 )
 return num1
 if 59 - 59: Oo0Ooo . OO0OO0O0O0 * iiiIIii1IIi . iII111iiiii11 % I1IiiI
def IIi1IiiiI1Ii ( num1 , num2 ) :
 I11i11Ii = num2
 oO00oOo = 0
 while I11i11Ii > 0 :
  oO00oOo = oOOo ( oO00oOo , num1 )
  I11i11Ii = ii ( I11i11Ii )
  if 92 - 92: O0O / oo000i1iIi11iIIi1 % Iii1IIIiiI + iI - Oo / o0O
 return oO00oOo
def hgj ( num1 , num2 ) :
 I11i11Ii = num2
 oO00oOo = 1
 while I11i11Ii > 0 :
  oO00oOo = IIi1IiiiI1Ii ( oO00oOo , num1 )
  I11i11Ii = ii ( I11i11Ii )
  if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * o00O0oo
 return oO00oOo
def O0oOO0o0 ( num1 , num2 ) :
 return oOOo ( num1 , - num2 )
 if 9 - 9: o0o - OOO0o0o
 if 40 - 40: II / oo00 * Iii1IIIiiI * o0o . ooOoO0o
print(hgj ( 9 , 9999 ))
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3

Sorry I used a obfuscator, but it isn't forbidden and way easier. (And I didn't have all that time to do it myself...)

Now, I don't even understand that code for myself...

It's easy to deobfuscate, but the questions which it might fit all seem to be tagged [tag:busy-beaver]...

Nice obfuscation!

This computes 9**99 without printing anything (Also taking a long time to do it)

@PeterTaylor It isn't a busy-beaver question, I just took a strange way to solve the question.

@OldBunny2800 If you want to try it out yourself, it's called pyobfuscate. Here's the github repo: https://github.com/astrand/pyobfuscate

You can put us out of our misery now...

Cracked.

Ruby (cracked by DLosc)
p n = gets.to_i
p n = n*(3*n-1)/2 until n % 7 == 0

Whoops, I missed the first p when I copied the code over. Cracked, then.

Python 3, ~2000 bytes, (safe: 23 points)

Original Program
exec("\n))o0000o000o<)]))]00000o000o[0o0o0o0o0o0o0o0o0o(00000000000000o0o(000000000000000o0o ni oooo0oooo rof)))0o0o0o0o0o0o0o0o0o(00000000000000o0o(000000000000000o0o ni 00oo00oo00oo00oo00oo rof]oooo0oooo[]00oo00oo00oo00oo00oo[0o0o0o0o0o0o0o0o0o(000ooo000ooo000o[ +]0o0o0o0o0o0o0o0o0o ni 00oo00oo00oo00oo00oo rof)00oo00oo00oo00oo00oo(000ooo000ooo000o[ni ooo000ooo000o rof)ooo000ooo000o(o0o0o0o0o-o0000o000o(000ooo000ooo000o(00o00o00o(tnirp\n)00000o000o,00000o000o(tresni.o0o0o0o0o0o0o0o0o0o:))00000000000000o0o=yek,0o0o0o0o0o0o0o0o0o(xam(00000000000000o0o<)o0o0o0o0o0o0o0o0o0o(00000000000000o0o elihw \n:)]00000o000o[]o0oooo,0o0o0o0o0o0o0o0o0o[( ni o0o0o0o0o0o0o0o0o0o rof\n;'=01NgwiNgwSNbBibpBybw8GMwAzbw8GM'b,]0o0o0o0o00oo ni ooooo0o00oo rof]]::0oooooo0oooo[))ooooo0o00oo(0oooooo(o0oooo ni ooo000ooo000o rof)ooo000ooo000o(00o00o00o[[=ooooo00oo,0o0o0o0o0o0o0o0o0o\n)'=kSZsBXd0BCLn5WayR3cgwCdulGK'b(0o0o.)(0o0ooo0o00ooo.o000oo esle o0000o000o fi o0000o000o+o0000o000o=0oooooo0oooo;)000000000000000o0o(o00oo00o=000000000000000o0o;)))(edoced.)o0o(0oo000o(000000o(o000oo,))(]o0000o000o[]edoced.)'==QbhRHa'b(0oo000o,'oo0o0o00o'[(oo0o0oo=o0o0o0o0o,oo0o0o0oo\n;)00000000000000o0o(o00oo00o,))(edoced.)'vJHZ'b(0oo000o(o00oo00o,)'bin'(o00oo00o=00000000000000o0o,0oooooo,o0oooo;))0000o0o0o(000000o(o000oo:0000o0o0o adbmal = o00oo00o ;)))(0o0oo00o(0oooooo(0o0oo0oo=0o0o0o0o00oo\n00000000000001**o0000o000o=o0000o000o;))(edoced.)'=cSbhRHanwCd1BnbpxyXfRncvBXbp91Xs4WavpmLnAyJ'b(0oo000o(o000oo=o0oo0oo00o,0o0oo00o,o0oo0oo,0o0oo0oo;edoced46b.)000oo0o(oo0o0oo=0oo000o\n;'==QYsxGKb92bwADMvVCN8EDIm9mcg8GMvBSauBybw82bwADMvBzbdliKq4SN'b ,))0o0oo00oo(000000o(__tropmi__ :0o0oo00oo adbmal,'base64',]0o0oo00oo[:0o0oo00oo adbmal = oo00oo00oo00oo00oo00oo,oo0o0oo,000oo0o,0oooooo\n;tni,'range','len','==Abh1mYkFGIv9GMwAzb682bwADMvBSYuRGIv9GMvBzbw82buYWYjR3bylWYshybvBDMw8WLxkiKqITJv9GMwAzb'b,lave,0**0000000000000009,0 ,]1-::[0o0ooo0o00o0oo:0o0ooo0o00o0oo adbmal,mus = 00o00o00o,000000000000000o0o,00000000000000o0o,o0o,o000oo,o0000o000o,00000o000o,000000o,000ooo000ooo000o\n"[::-1])

Challenge
This is in fact an answer for my own challenge, Primenary Strings. I chose this as almost everything will output 0, apart from a few inputs that a robber would be unlikely to enter. The code is a simple algorithm, but heavily obfuscated (by hand).

Pyke, 3458 bytes, SAFE, score 99
wB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddsQI30>Q%)

Try it here!
There are a few (30) 0x1b bytes that seem to have been eaten by SE.

you can mark this as safe now

Haskell, SAFE
m f=map(f<$>)
g=reverse.("":)
f s|(f:c:s)<-m fromEnum.g.words$s,
    (f:c:s)<-init.unwords.g.m(\s->toEnum$if c!!0==s||s==sum(-32:c)then(last$f)else s)$s=init$s

Try it on Ideone. "Usage":
Prelude> f "Programming Puzzles & Code Golf"
"rogramming Puzzles "

In the String Shenanigans challenge one is given a string and two chars and should then replace every occurrence of the first char with the second. However, the input is one string only containing the actual string in quotation marks and the two characters whitespace separated:
Prelude> f "\"Hello, World!\" l r"
"Herro, Worrd!"

Octave, 40 points. SAFE
Slightly obfuscated answer to a fairly popular challenge.
y=find((x=mod(input('')*2,32))>12);sign(sum(x.*[1-y:nnz(x+8)-y]))

I recommend testing this on octave-online. Ideone is not that good when it comes to STDIN.

This was the lever simulator 2015 challenge. Input on the form '123^32. Output will be -1 0 1 for Left-heavy, Balanced and Right-heavy in that order.
It looks like this when it's fully golfed:
s=mod(input(''),16);i=find(s>9);s*[1-i:numel(s)-i]'*inf

This outputs -Inf, NaN, Inf for L,B,R respectively.

why did Oliver edit in the byte count? this isn't codegolf, and the answer doesn't have to be competitive to the challenge, just valid

JavaScript, 533 bytes, Cracked! by Dave
_=this;[490837,358155,390922].map(y=function(M,i){return _[[
U=[y+[]][+[]]][+[]][i]]=_[M.toString(2<<2<<2)]});function g(
s){return Function("a","b","c","return "+s)};e=g(u(["","GQ9\
ZygiYTwyPzE6YSpk","C0tYSki","SkoYSkvZChhLWIpL2QoYikg"].join(
"K")));h=g("A=a,B=b,g('A(a,B(a))')");j=g("a/b");L=g("Z=a,Y=\
b,g('Z(a,Y)')");k=L(j,T=2);F=g(u("KScpKWIsYShFLCliLGEoQyhEJ\
yhnLGM9RSxiPUQsYT1D").split("").reverse().join(""));RESULT=F
(h(e,k),j,g("_[U[10]+[![]+[]][+[]][++[+[]][+[]]]+[!+[]+[]][\
+[]][+[]]+17..toString(2<<2<<2)].pow(T,a)"));

Not my favorite obfuscation of mine, but it's kinda neat. Call as RESULT(inputs).
I might award a +50 point bounty if you explain in detail what my code is doing along with your crack. (They do not have to be together, so feel free to FGITW if that suits your whims.)

Cracked! http://codegolf.stackexchange.com/a/100591/8927

Pip, 13 bytes
V$.C(A*a-A9)a

Try it online (give input as Arguments, not Input).

TeX, 240 bytes, SAFE, score 129
\let\N\newcount\let\I\ifnum\let\A\advance\let\E\else\N\a\N\b\N\c\def\D#1:#2:#3:{\I#1>#2\A#1by-#2\D#1:#2:#3:\E\I#1=#2 #3=1\E#3=0\fi\fi}\def\P#1:#2:{\I#1>#2\a=#1\D\a:#2:\c:\I\c=0\b=#2\A\b by1\P#1:\the\b:\E N\fi\E\I#1=1 N\E Y\fi\fi}\P1:2:\end

Save as jeopardy.tex, then run pdftex jeopardy.tex and open jeopardy.pdf.
Outcome: a PDF with the text N (and the page number 1).

Python 3, Cracked!
Writing this was hilarious, even though it was easily crackable in the end :)
Z,O=__import__('time').strftime,401*5;from base64 import*;Q,I=(Z('%Y')),(O/401)*2;_=int(Q);D,P=(O,-~_),int(Q[~1:]);Q,I=(6+(P-eval(b64decode(b'KHN1bShbeCU0PDEgZm9yIHggaW4gcmFuZ2UobWluKEQpLG1heChEKSldKSk=').decode()+'*-1'*(O>_)))/10,'3'+repr(((P-10)*3)+10));print(Q,I)

base64 encoded message: (sum([x%4<1 for x in range(min(D),max(D))]))

yep, just threw that in for fun @BlueEyedBeast

For some reason. substituting that decoded string in gives me a TypeError >.>

@Yodle Does the original code work? If so, just make sure you substitute the decoded string in properly

Yeah it does, which is why I am very confused haha.  I'm pretty sure I'm doing it right, just removing base64decode(...).decode() with the string right?

cracked.

@Yodle now that it's cracked, I'll tell you why you probably have an error: You need to put quotation marks around the subsituted code.

@Maltysen good job!

@Flp.Tkc Aha, I tried doing str() around it but I might've done that wrong.  I was on the right track though :P

Pyke, 42 characters, SAFE, score 85
This was probably unfair as the code stopped working in the try-it link 3 days after this answer was posted. I am happy for this answer to be non-competing
cFDhkR.dۢ㒶οd-~o@l3{IoKRKn)R+(Jt~o16q*Q|

Try it here!
Subliminal message intended towards cracker.

㒶 really belongs there?

yep and so do the other 3 unprintables

You mean 4 unprintables, right?

yes I do - (one of them is invisible in my browser/blends in)

This doesn't seem to be a good answer to the original challenge. You're simply splitting the text into new words on each line, regardless of where the capital letters are.

@StewieGriffin The try-it-here link worked for at least 3 days before I made a breaking change. I agree that was pretty unfair. Last working commit: https://github.com/muddyfish/PYKE/commit/5c2cd9a243f79d449ae847885608d38bc264d26c. Or this new link that works on the new version (an extra d character is required as I changed the default for Join to a newline rather than a space) http://pyke.catbus.co.uk/?code=cFDhkR.d%05%DB%A2%05%04%E3%92%B6%CE%BFd-~o%40l3%7BIoKRKn%29R%2B%28dJt~o16q%2aQ%7C

Pyke, 20 bytes, SAFE, score 59
uÄCMX67+*]mA""R`.:

Try it here!

Pyth - Cracked by Maltysen
If it helps, Pyth was not any of the answers to the hidden challenge.
u=.+G.*A

Try it out!

cracked?

Cracked! That was fast.

C#, 91 bytes
_=>{int b=0,w=0;for(;1>w||0<*(_-1);b+=++w**_++<<(9*w));return b%(3<w?903302656:41458688);};

Mathematica, 34 bytes, Cracked
±1={±0={}};±n_:=Array[±#&,n,0]

Named function (±).

I can't tell whether it's this and you overlooked the "No digits 0 to 9 to appear in the code" rule, or whether it's this and you decided to take unary input for obfuscation.

Whoops, it's the first one, but I totally missed that rule... I'll change the code to fit the other one :)

Cracked then. ;)

Pyke, 18 bytes, SAFE, score 54
2fm}s"ab"NQlZh.&|!

Try it here!

Pyke, 19 bytes, SAFE, score 51
4\Y:\m+Ay""%b%y"cl2

Try it here!

C++14, Cracked
#include<vector>

auto h(auto i){return 0;}
auto h(auto i, auto x, auto...p){
 return x+(i-1?h(i-1,p...):0);
}

auto g(auto v){return v;}
auto g(auto v,auto x, auto...p){
 v.push_back(h(x,x,p...));
 return g(v,p...);
}

auto f(auto...p){
 return g(std::vector<int>{},p...);
}

Takes a variadic number of parameters and returns a vector<int>.
Usage:
int main() {
 auto v = f(4,7,3,4,5);
 for (auto i:v) std::cout << i << ", ";
 std::cout << std::endl;
}

The title says C++14, so you need at least g++ and if your version is not at least 6.2 or something you need -std=c++14

Cracked

BrainFuck - 140 Bytes, Cracked by daHugLenny
,>,>,>-[>+<-----]>---[<+>-]<[<<<->>>->+<]>[<<<->>>->+<]>[<<<->>>-]<<<[>+<-]<[>>++++++++++<<-]<[>>>>++++++++++[<++++++++++>-]<<<<-]>>>[>.+<-]

Try It Here!

Cracked

Mathematica, 161 bytes
Which[LetterQ@#,If[UpperCaseQ@#,ToUpperCase,#&][FromLetterNumber~Array~LetterNumber@#],DigitQ@#,Array[IntegerString,FromDigits@#+1,0],True,#]&/@Characters@#<>""&

Ruby, 50 bytes
count = 0; 400.times do count +=1; end; puts count

output: 400

Cracked.

Python 2.7, 45 bytes
import numpy;lambda a,n,t:numpy.arange(a,t,n)

Hint (or maybe not): "the fish is in using numpy."
2016.11.23 - second hint: "Don't leave anything floating around!"

Are all three inputs strictly necessary? Could this still work if you hard code one (or more) of the inputs?

@StewieGriffin Yes. The questions explicitly requires three inputs; as well in the text as well as in the test cases.

Jelly, 1 byte, cracked
Ṛ

Body must be at least 30 characters; you entered 15.

Ṛ Reverse array Does not vectorize. from:https://github.com/DennisMitchell/jelly/wiki/Atoms

http://codegolf.stackexchange.com/a/100370/31343 cracked?

If this wasn't cracked, you would have gained -22 points :p

It's golf so -22 points is good, right?

Now it's -23 points, to be exact. That one is a remnant of my immaturity stage.

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