text:
Try to make a cube!
Based on this: Make me a square!
You need to output this:
  ####
 # # #
###  #
# # #
####

Where "#" is replaced with the input.
If you input "A", you should get
  AAAA
 A A A
AAA  A
A A A
AAAA

If you input "&", you should get
  &&&&
 & & &
&&&  &
& & &
&&&&

Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 121651; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Well, this is somewhat similar, although at least it's not a 3-byte answer in Charcoal this time...

@Neil it will probably be 4 bytes. Formula: b=d+1 where b is the number of bytes and d is the number of dimensions used.

Can the last two lines have leading spaces and can the result have leading newlines?

@dzaima yes, they can.

Ｂ³Ｓ‖Ｏ↗ it may very well be close to a 10 byte answer in charcoal though... I just don't know the language well enough to do it, there really needs to be a page like this but for charcoal.

Wishing that I understood charcoal inputs

Leading space in each row aligned? That would give the pattern shifted 1 unit right

It would have helped a lot if a bigger cube was used so that hardcoding wasn't so darn hard to beat.

@xnor i will make a better one. what is the sandbox

@AAlex Sandbox

I don't see how this is a dupe of the square one

@LuisMendo this definitely not a dupe. There isn't a single answer that you could port from that question to this one.

@Satan'sSon I'm not voting to reopen because I would (un)hammer it. Feel free to vote yourself

"Hammer it"? What's that? @LuisMendo

When you have a gold badge in one of the challenge's tags, you can single-handedly close it as a dupe, and I think you can undo a dupe-close too; no other people's votes needed

@carusocomputing Here, and here

Related

Carrot, 31 bytes
  ####
 # # #
###  #
# # #
####

#s are replaced by the input.
Basically a port of this answer, to this problem.

that looks like it took hours to golf...

@KritixiLithos 200 rep because you made a cool language, this doesn't seem fair xD

05AB1E, 16 15 bytes
ð‚•nxвΛ•2вèJ6ô»

Try it online!
Explanation
ð‚                # push the list [<input>,<space>]
  •nxвΛ•          # push the number 816342339
        2в        # convert to list of base 2 digits
          è       # index into the the 2-char string with this list
           J      # join to string
            6ô    # split into pieces of length 6
              »   # join on newlines

Can you encode the newline within the list/number to save the last 3 bytes?

@Rod That'd be a much larger number, 6 bytes at the very least, plus an extra byte or two to include the newline in the list...

@Rod: You could do something like this. Unfortunately that turns out a bit longer. Good idea though.

•nxвΛ•bTRð¹ì‡6ô»... yours beats transliterate slightly, only due to the ordering requirements; if I could figure out a way to implicitly take input and generate the string 01 in 1-byte, this would be a 13/14 byte solution.

@carusocomputing •nxвΛ•bTð¹«‡6ô» or ð«T•nxвΛ•br‡6ô» is same length.

@Emigna I meant if I could reorder ‡ to be c.replace(b -> a), but that's not really possible. Heh. Smart organization of that reverse though.

Cubix, 62 bytes
./v<.o;.@?/;w.w;i:::::NrSs::SrSuUS::sN::rS:r:srNr:SrSsNs:::SSv

Try it online! and Watch the interpreter!
This fits onto a 4-cube:
        . / v <
        . o ; .
        @ ? / ;
        . . w ;
i : : : : : N r S s : : S r S u
U S : : s N : : r S : r : s r N
r : S r S s N s : : : S S v . .
. . . . . . . . . . . . . . . .
        . . . .
        . . . .
        . . . .
        . . . .

I'm not very good at manipulating the direction of the instruction pointer, so I will continue to try and golf this. Both this and my answer here are based on the "Hello, World!' example program using ./v.o;@?/ (on a 3-cube) to recursively print and pop the characters on the stack, so the rest of the code is just pushing the characters onto the stack in the right order.
I have now made a cube on a cube, so I can rest easy (and do my actual work).

SOGL, 13 10 bytes
Βū&⁵'r⁹‘6n

Explanation:
Βū&⁵'r⁹‘    push "  ŗŗŗŗ ŗ ŗ ŗŗŗŗ  ŗŗ ŗ ŗ ŗŗŗŗ", where "ŗ" is replaced with input
        6n  split into lines of length 6

How is this sitting at 0? Probably due to lack of a TIO ._. +1

I think that there's gonna be at (hopefully) most 1 more update breaking stuff and then I'll think about some online running thing

Son Of a Golfing Language?

@ETHproductions lol

String Oriented Golfing Language

MATL, 13 10 bytes
Thanks to Conor O'Brien for removing 3 bytes, and for showing me that unprintables can be used in Octave.
The code contains unprintable characters. Try it online!
Explanation
'....'   % Push 5-char string (contains unprintables). Each char encodes a row
         % of the desired pattern
B        % Convert to binary. Gives a 5×6 binary matrix with the pattern
*        % Implicit input. Multiply element-wise (converts input to ASCII code)
c        % Convert to char. Implicitly display. Char 0 is shown as space

You can make this 10 bytes if you're okay with unprintables. Try it online!

@ConorO'Brien Hey, thanks! I wasn't sure Octave was okay with those... how did you even type them?

Well, I honestly I took the numbers, converted them to hex, then did echo 0f15392a3c|xxd -r -p|clip. On windows, clip is the clipboard. Then I just pasted them :P (If you're on a command line, it's ^O^U as well)

@ConorO'Brien That's way over my head. You should really post that as your answer

It uses the same tactic as yours does, just removing the need for modulo 64 by using the values directly.

PHP, 52 Bytes
<?=strtr("  0000
 0 0 0
000  0
0 0 0
0000",0,$argn);

Try it online!

Japt, 20 bytes
"OUyj|"®c ¤Åd0S1U +R

Test it online!
Not too bad for a language with no built-in compression (well, except compressing strings of lowercase letters)...
Explanation
In binary, the five characters in the string are:
O 1001111
U 1010101
y 1111001
j 1101010
| 1111100

Slice off the initial 1 from each, and you get the pattern for the cube.
"OUyj|"®   c ¤  Å  d0S1U +R
"OUyj|"mZ{Zc s2 s1 d0S1U +R}  // Expanded
                              // Implicit: U = input string
"OUyj|"mZ{                 }  // Replace each character Z in this string with this function:
          Zc                  //   Take the char-code of Z.
             s2               //   Convert to a binary string.
                s1            //   Slice off the first character (always a "1").
                   d0S1U      //   Replace "0"s with spaces and "1"s with the input.
                         +R   //   Append a newline.
                              // Implicit: output result of last expression

I tried a template-based approach (ll can be compressed), but it's 11 bytes longer.

Nice. I was down to 23 bytes before I realised I'd made a balls of it!

LOLCODE, 202 170 bytes
I HAS A c
GIMMEH c
VISIBLE"  "AN c AN c AN c AN c AN":) "AN c AN" "AN c AN" "AN c AN":)"AN c AN c AN c AN"  "AN c AN":)"AN c AN" "AN c AN" "AN c AN":)"AN c AN c AN c AN c

In LOLCODE, not much to golf...
This sets the variable c into the input, and creates a giant concatenated string including :) newlines. That's about it.

expected HAI at: I https://tio.run/nexus/lolcode#@@@p4OEYrOCokMzl7unr6@oBZIR5Bns6@bgqBPv6@wd7KCgpAJGjn0IyFkLJShNJUgkX20oTmwkoBqOoIdGgZAVfb8fI//@VAQ

Also, VISIBLE implicitly concatenates, so you can remove SMOOSH https://tio.run/nexus/lolcode#@@/h6KlgqGfE5ang4Ris4KiQzOXu6evr6gFkhHkGezr5uCooKQCRo59CMhZCyUoTSVIJF9tKE5sJKAajqCHRoGQu7xCPCKdI1///lQE

To your first thing, there are some interpreters that don't require HAI or KTHXBYE, e.g. REPL.it. To your second thing, thank you!

Sed, 40 characters
s/./  &&&&\
 & & &\
&&&  &\
& & &\
&&&&/

Almost cheating as the challenge description contained it almost literally.
Sample run:
bash-4.4$ sed 's/./  &&&&\
 & & &\
&&&  &\
& & &\
&&&&/' <<< 'C'
  CCCC
 C C C
CCC  C
C C C
CCCC

Try it online!

Python 2, 61 bytes
lambda c:"""  ####
 # # #
###  #
# # #
####""".replace('#',c)

Try it online!

Z80 Assembly, 37 bytes machine code
Assume a memory mapped I/O device:

; DO NOT INPUT A SPACE or it will go into infinite loop printing spaces & newlines!

3A xx xx    ld  a, (input)  ; get input character
11 0A 20    ld  de, 200ah   ; space & newline
21 yy yy    ld  hl, output  ; get output address
4F          ld  c, a        ; put character in c
loop:
72          ld  (hl), d     ; output space * 2       | output character * 2
72          ld  (hl), d
77          ld  (hl), a     ; output character       | output character
71          ld  (hl), c     ; output character * 2   | output space * 2
71          ld  (hl), c
77          ld  (hl), a     ; output character       | output character
73          ld  (hl), e     ; output newline         | output newline
72          ld  (hl), d     ; output space           | output character
71          ld  (hl), c     ; output character       | output space
72          ld  (hl), d     ; output space           | output character
71          ld  (hl), c     ; output character       | output space
72          ld  (hl), d     ; output space           | output character
B9          cp  c           ; set zero flag 1st time | clear 2nd time
20 06       jr  nz, end     ; skip to end
77          ld  (hl), a     ; output character
73          ld  (hl), e     ; output newline
4A          ld  c, d        ; put space in c
57          ld  d, a        ; put character in d
28 FB       jr  z, loop     ; loop to 2nd time
end:
73          ld  (hl), e     ; output newline
77          ld  (hl), a     ; output character * 4
77          ld  (hl), a
77          ld  (hl), a
77          ld  (hl), a
76          halt            ; or C9 ret

V, 27 bytes
4äl2>>Äyvho3pÄÙ3älWx<<3Îd^

Try it online!
Hexdump:
00000000: 34e4 6c32 3e3e c479 7668 6f1b 3370 c4d9  4.l2>>.yvho.3p..
00000010: 33e4 6c57 783c 3c33 ce64 5e              3.lWx<<3.d^

I'm pretty sure you can replace o<esc> with just ï

Charcoal, 17 16 bytes
ＳβＧＨ7+↗→³β→Ｇ↓↙³β

Try it online! Link is to verbose version of code. Longer than I wanted it to be, because the "cube" is slightly wider than it is tall or deep. Fortunately some of the multidirectional characters work with PolygonHollow, which saves me 3 bytes. Edit: Saved a further byte by using + instead of T↑. Explanation:
Ｓβ          Input the character
ＧＨ7+↗→³β    Draw the left half. 7 becomes ←↙ and + becomes →↓←↑.
→           Move right one character.
Ｇ↓↙³β       Draw the right half.

At the time of the challenge, the q variable didn't work in verbose mode, otherwise I could have created this 14-byte version:
ＧＨ7+↗→³θ→Ｇ↓↙³θ

Try it online!

PHP, 72 bytes
I made this one just for the fun of it, since there's already a better PHP answer.
for($i=0;$i<27;)echo('00'.decbin(64349871))[$i]?$argn:' ',++$i%6?'':'
';

The cube is drawn by getting the binary value of 64349871, concatenated by '00'.
This returns the following:
0011110101011110011010101111

Every 6th character, I'm outputting a newline, resulting in this:
001111
010101
111001
101010
1111

And, instead of displaying 0, it displays a space, which will look like:
  1111
 1 1 1
111  1
1 1 1
1111

Stacked, 31 bytes
' '\+$'9*<'#.2 tb[6 dpad]map#

Try it online!
Here's a hexdump:
λ xxd try-to-make-a-cube.stk
00000000: 2720 275c 2b24 270f 1539 2a3c 2723 2e32  ' '\+$'..9*<'#.2
00000010: 2074 625b 3620 6470 6164 5d6d 6170 23     tb[6 dpad]map#

This converts a character array to binary, pads each row to length 6, and indexes it according to the string ' ' input +

Pyth, 25 22 21 20 bytes
jcsm?d\ zjC"0¨eC"2 6

Try it!
21 bytes
t::." \"o½MËñ"\!bNw

Try this!
Also 21 bytes:
:jbct." \" ±¢î
"6Nw

Try that!

JS (ES6), 64 60 52 bytes
i=>`  ####
 # # #
###  #
# # #
####`.replace(/#/g,i)

Can this be improved:
i=>`  ${y=i+i+i+i}
 # # #
###  #
# # #
${y}`.replace(/#/g,i)

y=i+i+i+i is shorter than y=i.repeat(4)

... and #### is even shorter.

Actually the whole thing's shorter without templates: Fiddle

C (gcc), 90 84 bytes
i;v;f(g){for(i=32;i--;)putchar((v="####*@#@#@#*#@@###*#@#@#@*####@@"[i])&1?g:v-32);}

Try it online! Defines a function f that takes a character g. Too bad encoding the table directly is shorter...
Old version, 90 bytes
(Still trying to golf this one)
Trying to have only a single putchar, but idk. There are unprintables, so here is the hexdump:
λ xxd try-to-make-a-cube.c
00000000: 693b 6a3b 6628 6729 7b63 6861 722a 6b3d  i;j;f(g){char*k=
00000010: 220f 1539 2a3c 223b 666f 7228 693d 303b  "..9*<";for(i=0;
00000020: 693c 353b 7075 7463 6861 7228 3130 292c  i<5;putchar(10),
00000030: 692b 2b29 666f 7228 6a3d 3332 3b6a 3b6a  i++)for(j=32;j;j
00000040: 2f3d 3229 7075 7463 6861 7228 6b5b 695d  /=2)putchar(k[i]
00000050: 266a 3f67 3a33 3229 3b7d                 &j?g:32);}

This encodes the cube into a binary lookup table, where a 1 bit represents the input and a 0 bit represents a space. Try it online!

Can shave a few bytes off for 81 bytes.

The unprintables one can be squeezed to 73 bytes.

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

Try it online!
Waaaaay too long.

Java 8, 55 bytes
c->"  ####\n # # #\n###  #\n# # #\n####".replace('#',c)

Try it here.
Java 7, 77 bytes
String c(char c){return"  ####\n # # #\n###  #\n# # #\n####".replace('#',c);}

Try it here.

Swift - 82 bytes + Foundation (18 bytes)?
var f={"  ####\n # # #\n###  #\n# # #\n####".replacingOccurrences(of:"#",with:$0)}

By default, Xcode-Swift projects have Whole-Module Optimization, so that import Foundation is not required for this simple lambda-like function. However, running it in online environments requires it, which may add 18 bytes.
Check it out!

Vyxal jr, 12 bytes
ðp»2<I∵»τ5$/

Try it Online!
  »2++++++<<++>],>++..<....<.>>.<.>.<.>.<.>.<<.>...>..<.<.>.>.<.>.<.<.>....

Try it online!
Not sure why this doesn't exist

CJam, 23 bytes
"pjFUC"{i2b(;}%rS+ff=N*

I feel like I can still golf this.
"pjFUC" e# String literal:          │ "pjFUC"
{       e# For each:                │ 'p
  i     e#   Get code point:        │ 112
  2b    e#   To binary:             │ [1 1 1 0 0 0 0]
  (;    e#   Delete first:          │ [1 1 0 0 0 0]
}%      e# End                      │ [[1 1 0 0 0 0] [1 0 1 0 1 0] [0 0 0 1 1 0] [0 1 0 1 0 1] [0 0 0 0 1 1]]
r       e# Read token:              │ [[1 1 0 0 0 0] [1 0 1 0 1 0] [0 0 0 1 1 0] [0 1 0 1 0 1] [0 0 0 0 1 1]] "&"
S       e# Push space:              │ [[1 1 0 0 0 0] [1 0 1 0 1 0] [0 0 0 1 1 0] [0 1 0 1 0 1] [0 0 0 0 1 1]] "&" " "
+       e# Concatenate:             │ [[1 1 0 0 0 0] [1 0 1 0 1 0] [0 0 0 1 1 0] [0 1 0 1 0 1] [0 0 0 0 1 1]] "& "
ff=     e# Vectorized array lookup: │ ["  &&&&" " & & &" "&&&  &" "& & & " "&&&&  "]
N*      e# Join with newlines       │ "  &&&&
        e#                          │   & & &
        e#                          │  &&&  &
        e#                          │  & & &
        e#                          │  &&&&  "
e# Implicit output

dc, 70 bytes
Encodes the sequence rather directly, with minor optimization:
8224PdPdPdPdP10Pd8192+ddPPP10PdPdPdP8224PdP10Pd256*32+ddPPP10PdPdPdPdP

Try it online!

Taken to a (not very golfy) extreme, 145 bytes:
27065671941896667324298575455432398417474802390765222440949482848513*56759961956005660143530475805610581704254588701249011343446231795984498688+P

Try it online!
This computes A*x+B, where A encodes the positions of the input character and B encodes all the rest:

A = 2560 + 2561 + 2562 + 2563 + 2565 + 2567 + 2569 + 25611 + 25614 + 25615 + 25616 + 25618 + 25620 + 25622 + 25625 + 25626 + 25627 + 25628
B = 10×2564 + 32×2566 + 32×2568 + 10×25610 + 32×25612 + 32×25613 + 10×25617 + 32×25619 + 32×25621 + 32×25623 + 10×25624 + 32×25629 + 32×25630

P command prints the resulting number as a byte stream.

Windows batch, 79 bytes
@echo   %1%1%1%1
@echo  %1 %1 %1
@echo %1%1%1  %1
@echo %1 %1 %1
@echo %1%1%1%1

Special char. safe, 97 bytes:
@echo   ^%1^%1^%1^%1
@echo  ^%1 ^%1 ^%1
@echo ^%1^%1^%1  ^%1
@echo ^%1 ^%1 ^%1
@echo ^%1^%1^%1^%1

Can you use line feeds i.e. ..  %1%1%1%1\n %1 %1 %1...

Line feeds are not supported in batch

I couldn't remember if they was or not and wasn't in a position to test :)

Sorry, I'm confused, can you repeat?

I couldn't remember if you could use them or not and I couldn't test at the time I commented so I left the comment so you would still have the idea

Line feed on my batch runs well for ECHO

C#, 53 bytes
c=>@"  ####
 # # #
###  #
# # #
####".Replace('#',c);

Tcl, 60 bytes
proc c x {regsub . $x "  &&&&\n & & &\n&&&  &\n& & &\n&&&&"}


text:
Old C Code Transmogrifier*
*What is a transmogrifier?
In the C programming language, there are formations called digraphs and trigraphs that are two and three characters sequences that evaluate to less common characters. For example, you can use ??- if your keyboard doesn't have ~.
Given text, replace all instances of the following digraphs and trigraphs (left side) with the correct, shorter, golfed character (right side).
??=  #
??/  \
??'  ^
??(  [
??)  ]
??!  |
??<  {
??>  }
??-  ~
<:   [
:>   ]
<%   {
%>   }
%:   #

Source
Input
Input is ASCII text. Trailing newline allowed. Does not need to be valid C code.
Output
Output is the same text, with all instances of the above digraphs and trigraphs replaced with the shortened version, evaluated left to right. Trailing newline allowed. Does not need to be valid C code.
Test Cases
=> separates input and output.
if (true ??!??! false) { => if (true || false) {

??-arr.indexOf(n) => ~arr.indexOf(n)

function f(??) { console.log('test??'); } => function f(] { console.log('test^); }

/* comment :> :) *??/ => /* comment ] :) *\

%:What am I doing??!!??` => `#What am I doing|!??

??(??)??(??) <:-- not a palindrome => [][] [-- not a palindrome

?????????? => ??????????

int f(int??(??) a) ??< return a??(0??)??'a??(1??) + "??/n"; ??> => int f(int[] a) { return a[0]^a[1] + "\n"; }

??<:>??<% => {]{%

<:> => [>

<::> => []

:>> => ]>

#\^[]|{}~ => #\^[]|{}~

: > => : >

??=%: => ##

Please remove the `s from the examples. It makes them so hard to read.

"??=%:" is another relevant test case: in C, this means "#%:" where %: isn't special, but I think your expected output is "##".

@Satan'sSon will do, I originally had it not in a code block to make input/output more readable but Riker changed it over. Feel free to edit something like formatting yourself next time :)

So, you're asking for golfed code to golf code. Bonus golf :-)

@Mast that's the idea

I just learned something about PHP...

Retina, 65 bytes
T`-=/'()!<>?`~#\\^[]|{}_`\?\?[-=/'()!<>]
<:
[
:>
]
<%
{
>%
}
%:
#

Try it online! T is a little awkward to use but still saves me 14 bytes.

Can you do \?\?[^:%]?

(\?\?[^:%?] rather)

@ETHproductions That would have a side effect of also turning ??a into a.

@eush77 Oh hmm, you're right...

Line 8 should be %> instead of >%.

@Dennis Ugh, that means rewriting the entire post...

It does? What else depends on line 8?

@Dennis The TIO link uses an old format, and I don't know how to tweak the link to switch the characters over, so I'd have to start with a new TIO autogenerated block.

C, 206 205 bytes
(-1 thanks to ceilingcat)
The newlines are just here for readability.
c,d,q;f(char*s){for(char*S,*T,*t=s;c-63?q=0:q++,d=c<<8|*s,*s?
q>1&&(T=index(S="=/'()!<>-",*s))?t-=2,*s="#\\^[]|{}~"[T-S]:
d>*s&&(T=strstr(S=">:<>%<:%",&d))&&(c="][ }{ # "[T-S])&1?--t,*s=c:0:
0,*t++=c=*s++;);}

Modifies s in place. Tested with GCC and clang on Fedora Workstation, x86, in 32-bit and 64-bit mode.
C is not exactly the best language for golfing here.

C is not exactly the best language for golfing here. no kidding. Looks good :) Thinking back, I should have forced all questions to add +1 or +2 bytes if they used one of the characters that a digraph or trigraph makes xD

You could make it even worse: +1 or +2 for each character that can be part of a di-/trigraph would really hurt :)

JavaScript (ES6), 106 bytes
s=>[...'#\\^[]|{}~[]{}#'].map((c,i)=>s=s.split('<:<%%'[i-9]+':>%>:'[i-9]||'??'+"=/'()!<>-"[i]).join(c))&&s

How?
This is pretty straightforward.
We should note however that:

When i is less than 9, the expression '<:<%%'[i-9] + ':>%>:'[i-9] evaluates to undefined + undefined which equals NaN (falsy as expected).
When i is greater than or equal to 9, the expression '??' + "=/'()!<>-"[i] evaluates to "??" + undefined which is coerced to the string "??undefined" (truthy when we expect a falsy result).

That's why we must process the test in this order.
Test cases

let f =

s=>[...'#\\^[]|{}~[]{}#'].map((c,i)=>s=s.split('<:<%%'[i-9]+':>%>:'[i-9]||'??'+"=/'()!<>-"[i]).join(c))&&s

console.log(f(`if (true ??!??! false) {`))                                        // `if (true || false) {`
console.log(f(`??-arr.indexOf(n)`))                                               // `~arr.indexOf(n)`
console.log(f(`function f(??) { console.log('test??'); }`))                       // `function f(] { console.log('test^); }`
console.log(f(`/* comment :> :) *??/`))                                           // `/* comment ] :) *\`
console.log(f(`%:What am I doing??!!??`))                                         // `#What am I doing|!??`
console.log(f(`??(??)??(??) <:-- not a palindrome`))                              // `[][] [-- not a palindrome`
console.log(f(`??????????`))                                                      // `??????????`
console.log(f(`int f(int??(??) a) ??< return a??(0??)??'a??(1??) + "??/n"; ??>`)) // `int f(int[] a) { return a[0]^a[1] + "\n"; }`
console.log(f(`??<:>??<%`))                                                       // `{]{%`
console.log(f(`<:>`))                                                             // `[>`
console.log(f(`<::>`))                                                            // `[]`
console.log(f(`:>>`))                                                             // `]>`
console.log(f(`#\^[]|{}~`))                                                       // `#\^[]|{}~`
console.log(f(`: >`))                                                             // `: >`

PHP , 112 Bytes
<?=str_replace(explode(_,strtr("<:_:>_<%_%>_%:0=0/0'0(0)0!0<0>0-",["_??"])),str_split("[]{}##\\^[]|{}~"),$argn);

Try it online!
PHP , 115 Bytes
<?=str_replace(explode(_,"??=_??/_??'_??(_??)_??!_??<_??>_??-_<:_:>_<%_%>_%:"),str_split("#\\^[]|{}~[]{}#"),$argn);

Try it online!
PHP , 124 Bytes
Regex solution

foreach(explode(_,"=|%:_/_'_\(|<:_\)|:>_!_<|<%_>|%>_-")as$v)$a=preg_replace("#\?\?$v#","#\\^[]|{}~"[$k++],$a=&$argn);echo$a;

Try it online!

Ruby, 104+1 = 105 bytes
Uses the -p flag for +1 byte.
"=#/\\'^([)]!|<{>}-~".scan(/(.)(.)/){|k,v|gsub'??'+k,v}
"<:[:>]<%{%>}%:#".scan(/(..)(.)/){|k,v|gsub k,v}

Try it online!

Javascript (ES6), 131 123 bytes

f=
s=>"#??= \\??/ ^??' [??( ]??) |??! {??< {??> ~??- [<: ]:> {<% }%> #%:".split` `.map(x=>s=s.split(x.slice(1)).join(x[0]))&&s
<input oninput=console.log(f(this.value))>

JavaScript (ES6), 113 bytes
s=>s.replace(/\?\?[^:%?]|[<:%]./g,c=>"#\\^[]|{}~"["=/'()!<>-".indexOf(c[2])]||"[] {} #"["<:><%>%:".indexOf(c)]||c)

Not the shortest, but I wanted to try a different approach.

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:
Construct a beacon
In the video game Minecraft, you can obtain beacons and put them on pyramid-like structures to give you special effects, such as speed or jump boost.
Your task is to, given an effect, construct the beacon pyramid required for it.
There are multiple sizes of beacon pyramids, required for different effects. The largest has a size 9 base, and the smallest has a size 3 base.
These are the effects you can get, and the required pyramid for them (as specified by the official Minecraft wiki:
3:
  Speed I
  Haste I
5:
  Resistance I
  Jump Boost I
7:
  Strength I
9:
  Regeneration I
  Resistance II
  Jump Boost II
  Speed II
  Haste II
  Strength II

Beacons are constructed with the base at the bottom, then it goes up, decreasing the size by 2. Once we hit 1, there should be a beacon + at the top.
A beacon is defined as a +, but it needs a supporting pyramid to work.
You may assume the input is valid (ie, it is one of the effects specified here), and, optionally, you may assume the input is all lowercase. The # character should be used in the pyramid, and + as the beacon.
Examples:
Haste I
 +
###

Resistance I
  +
 ###
#####

Strength I
   +
  ###
 #####
#######

Regeneration I
    +
   ###
  #####
 #######
#########

Speed II
    +
   ###
  #####
 #######
#########

You must also take multiple effects as beacon pyramids can share blocks - however, one beacon cannot do more than one effect. You must use minimal blocks.
When taking multiple effects, you may use any reasonable input format such as a list, newline separated, etc. Additionally, you may take a singleton list for single beacons if you are using lists.
For these examples, I only list one possible solution, but there are multiple acceptable solutions.
Speed I, Haste II
    ++
   ####
  #####
 #######
#########
(another acceptable solution is the following,
these are both valid as they use the same amount of blocks)
    +
   ###
  #####
 #######+
##########
(the following is not valid for the same input; it doesn't use minimal blocks)
    +
   ###
  #####           +
 #######         ###
#########

Strength I, Strength I
   ++
  ####
 ######
########

(don't output things in brackets, if that isn't obvious enough)

It seems most of this challenge is about the combining of the pyramids, but you don't describe the rules for doing so (if they can "share" blocks, why can we not just output the bigger one?). (Also you say we "may" take multiple, when I think you mean "must be able to")

@JonathanAllan Clarified.

No, I still do not know the rule for combining...

@JonathanAllan I said that one beacon cannot do more than one effect. Is that not clear enough?

OK I think I get it, you are calling the + a beacon as well as the whole pyramid. What you are saying is we must overlap the multiple pyramids in such a way as to show all the + characters while showing minimal # characters? (I had to figure this out from looking at the examples, it's not clear from the wording)

When I first looked at this I thought it would be trivial, and then I saw the part about having multiple beacon effects. :P

Python 2, 216 195 bytes
def b(e):s=sorted(63372>>len(_)*2-14&3for _ in e)[::-1];f=s[0]+2;r=range(f);print"\n".join(reduce(lambda p,n:[p[i]+"+# "[cmp(i,f-n-2)]for i in r],s[1:],[" "*(f-i-1)+"+#"[i>0]*(2*i+1)for i in r]))

Try it online!
The function for printing the string with the pyramid structure is b, which is called with a list of the effects as its single argument.
This turned out longer than I expected, but I was at least happy that I was able to find the beacon size based on black magic.
Edit: was able to reduce byte count significantly by combining the reduce function into a lambda thanks to Python 2's cmp function.

Well done on your black magic ;)

Charcoal, 75 71 60 54 48 bytes
Ａ⟦⟧βＷＳ⊞βＩ§14034244⁻Ｌι⁷ＦＵＰsorted⟦β⟧«Ｇ→→↖⁺ι¹#¦+Ｍι↙

Try it online!
The Python answer is also mine, but I wanted to try my first golf submission in Charcoal!
I also wanted to make sure I can hold down that bounty ;)
Ａ⟦⟧β                        assign an empty list to β
ＷＳ                         while the next string input ι is truthy: (aka while the input is not an empty line)
    ⊞βＩ§14034244⁻Ｌι⁷       push level for ι into β (explained below)
ＦＵＰsorted⟦β⟧«             for each level ι in the sorted version of β:
    Ｇ→→↖⁺ι¹#                draw a triangle of "#"s with side lengths ι + 1
    ¦+                       draw a "+" (already on top vertex)
    Ｍι↙                     move down and left by ι cells (preparation for next level)
                             implicit end of for

All of the beacon names of the same length share a beacon level. As such, we can determine the beacon level of an effect from mapping the length (minus 7 to base it at zero) to the numbers in the string "14034244" (there is a 0 for clarity because length 9 does not correspond to an effect). This same idea is used in my Python answer, but with bit shifting to produce the numbers 0-3.

Thanks for using Charcoal! Also, I'd recommend adding the -a flag to print the AST if you want a kind of explanation in the TIO link as well

Also, 48 bytes, from changing the input to variable to the input nilary operator

Note, I'll be updating soon so ＷＳ⊞υＩ§14034244⁻Ｌι⁷Ｆ▷sυ«Ｇ→→↖⁺ι¹#¦+Ｍι↙ will be valid so keep in mind that υ and ▷s will be new

Thank you so much for the tips! I look forward to golfing more in Charcoal :D

Jelly, 68 bytes
FṀ‘
0;Ṗ
|Ç€|Ḋ€Ç|
⁽lƑb4‘ị@L€ṢµI‘ż@IṚṭṀṭ0Fs2+\µḅÑ‘Ṭ;0sÑµ+ÇÐLị“#+ ”Y;”#

Try it online!
I think the reason this is longer than the Charcoal answer (even though I was able to do my 'black magic' in 10 bytes) is because Charcoal was built for two-dimensional drawing. I ended depending on a 2D cellular automaton to find the positions of #s given the positions of +s to create triangles.
How it Works (main link split for readability)
FṀ‘
0;Ṗ
|Ç€|Ḋ€Ç|
⁽lƑb4‘ị@L€ṢµI‘ż@IṚṭṀṭ0Fs2+\µḅÑ‘Ṭ;0sÑµ+ÇÐLị“#+ ”Y;”# - Main link, input is list of strings
⁽lƑb4‘ị@L€Ṣ     - list of strings to list of heights (1,2,3,4)
⁽lƑ               - the number 28147
   b4‘            - base 4 and incremented: [2, 3, 4, 2, 4, 4, 1, 4]
        L€        - lengths of each input string
      ị@          - index into the list to get a list of heights
          Ṣµ      - sort and store for the next link:
I‘ż@IṚṭṀṭ0Fs2+\ - get list of coordinates for `+`s
I‘ż@I             - [0,1] between each element. Add [1,1]*n between each pair of elements with difference n
     Ṛ            - Reverse
      ṭṀṭ0        - prepend [0,maximum]
          Fs2     - format the array as a list of coordinate pairs
             +\   - cumulative sum
ḅÑ‘Ṭ;0sÑ        - convert to binary rectangular matrix:
ḅÑ‘               - change each coordinate pair (y,x) to y*width+x (Ñ is the width)
   Ṭ              - boolean array with 1s at the above indices
    ;0            - append a zero for formatting reasons
      sÑ          - split into rows of the right width
µ+ÇÐL           - add locations of `#`s:  the matrix now has 2s at future `+`s, 1s at `#`s, and `0`s at spaces
  ÇÐL             - repeatedly apply a step of the cellular automoton: 1s at `#`s and `+`s, and 0s at space
µ+                - add this to the matrix of `+`s which has 1s at `+`s.
ị“#+ ”Y;”#      - format into a string
ị“#+ ”            - index into the string "#+ ".
      Y           - join by newlines.
       ;”#        - append a `#` character to finish up the formatting.

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


text:
Rotation-safe quine
Write a proper quine whose every rotation is itself a proper quine.
For example, if your source code is abcdef, then:

abcdef would output abcdef
bcdefa would output bcdefa
cdefab would output cdefab
defabc would output defabc
efabcd would output efabcd
fabcde would output fabcde

A rotation "is made by splitting a string into two pieces and reversing their order".
Scoring
This is code-golf. Shortest answer in bytes wins. Standard loopholes apply.

So I could have program aaabbb and I could say that the next rotation is bbbaaa? Or would the next rotation have to be baaabb?

The next rotation is baaabb.

Side note, the standard Fission quine is a different quine of rotation-safe: no matter how you rotate it, it will always print the original source code.

I have a language that only recognizes eleven characters, and everything else is simply printed. Would this be considered cheating?

If a quine in a language is one byte, is that cheating?

@MDXF If it's one byte it's not a proper quine in most cases. Well, some binary language might have a proper 1-byte quine, such as the first four bits identify the other four bits or something like that, but non-binary ones certainly don't.

How 2D languages' code can be rotated?

What about a in PHP? Without <?php it returns a

Since you have no answers yet, you may consider allowing having either 'rotation softened' or 'rotation hardened' quines (i.e., output the original source or the rotated source). See my sandbox post which turned out to be a dupe of this challenge.

Just got one: ಠಠ in ಠ_ಠ, seems valid. (I do not want post it as answer, since i cannot understand what happening)

Is this a proper quine?

Alice, 138 128 74 70 bytes
<pp&a0Ra*880R9Z640R8Z5e0R7*a70R6Z060R5Z9e0R4Z4R20R3*79Y3Zea0eZ1R51!Z73

Unfortunately, I had to fix a bug in the interpreter to make this work, so the current version doesn't work on TIO. But you can try the 128-byte solution online.
You can use this Python script to verify that it works for all rotations, but again you'll have to run it locally against an up-to-date interpreter for the latest version. (Thanks to Jo King for providing that.)
Explanation (for 74-byte solution)
(Link to an explanation of the original 138-byte solution.)
I was trying find a 2D language for Razetime's bounty where this might be possible and it turned out that it's actually very feasible in Alice. Unfortunately, the solution is a one-liner, not making much use of the two dimensions. That said, I'd be very impressed if this is possible with an actual 2D program (in any language), because almost every rotation would have one line broken into two pieces (one at the start and one at the end). I imagine a language would have to have a) multiple explicit entry points and b) a way to determine where on the grid an instruction pointer is to pick one that starts in a "safe" region of the grid. And then you'd still have to implement a quine for this that can work out what the actual current rotation is. So... uhhh...
Printing the quine
Anyway, let's talk about this solution. I'm using grid manipulation (or self-modifying) command p to write our actual program into the grid. The main trick for letting me get below 100 bytes is to write that code outside the initial grid, specifically to the left of it (at negative x indices). This self-modification works regardless of the applied rotation (we'll get into why later), and prepends the following snippet to the code:
@o&J'h%p't"

This code will be executed from right to left. By the time we get here:

there might be some rubbish left on the stack (depending on the rotation) - in one case, there might be an iterator in the queue (more about that later)
in two cases (specifically those starting with a p) the first character of the original source code has been replaced with a null
otherwise the original source always remains unchanged.

Before we get into how and why this self-modification works consistently, let's look at what the new code does.
"   Toggle string mode. While in string mode, Alice records every
    codepoint the IP travels over (with some caveats that don't
    matter). Since there's only one " on the grid, we'll record
    every other cell, wrap around, and eventually hit " again.
    When we leave string mode again, all of the codepoints get
    pushed to the stack.
    There'll be a bunch of useless stuff at the bottom of the stack
    now but what's important is that the top 74 values are the
    original source code in reverse order.
    However, the leading 'p' might have been replaced with a null.
    Let's fix that.
t   Decrement.
'p% Modulo 112. Since 'p' is the biggest codepoint in the original
    source, this won't affect any value that corresponds to an
    actual character. But if we had a 0, -1 % 112 becomes 111.
h   Increment. We've now mapped 0 to 112 and left all values from 1
    to 112 unchanged.
'J  Push 74, which happens to be the length of the source code.
&o  Pop and print that many characters from the top of the stack.
@   Terminate the program.

Generating the printing code
On to the question of how we apply this source modification in the first place. Let's go back to half of the initial code:
<pp&ha0Na*880RaZ640R9Z5e0R8Z620R7Z060R6Z9e0R5Z4R20R4Z730R3Z060R2Zea0eZ1R51

We start on a < which makes the instruction pointer (IP) move west instead of east. The IP wraps around the edges, so we really start executing the code from the end and should once again read this code in reverse.
This makes use of p, which pops y, x, v and writes value/codepoint v to the location (x, y). We use ah& to execute p 11 times, though the second p will add a 12th invocation. It's important for those to happen only in one place in the code for all rotations to work. All the other stuff before that just prepares the stack with inputs for these twelve invocations of p. Breaking the code down into v, x, y triples:
v     x   y

          1
5R1Z  e   0
aeZ   2R  0
60Z   3R  0
37Z   4R  0
2R4Z  5R  0
e9Z   6R  0
60Z   7R  0
26Z   8R  0
e5Z   9R  0
46Z   aR  0
88*   aN  0

Apart from pushing individual digits, there are only a few commands of note here. e pushes -1. a pushes 10. R multiplies the top of the stack by -1. N computes the bitwise NOT. And then there's Z. You'll notice that most of them make use of it, the zip command. This command computes a bijection from a pair of integers to a single integer. The intended usage is to encode lists or other collections of numbers in a single number (to make it easier to store on the tape or the grid, for example), but it happens to be very useful for generating larger numbers in few characters. You can use this Alice program to figure out which two numbers you need to get the desired result.
Also note that there's an additional 1 at the bottom of the stack. This is the only relevant input for the 12th invocation of p. Since this is the y this writes some garbage somewhere on the second line of the program, which we'll never encounter.
Rotating the source
Finally, let's look at how various rotations of the source code behave. I'm going to shorten our "unrotated" source code to <pp&haZYX where ZYX represents the code that pushes all the constants. Let's go through the various possibilities:
pp&haZYX<

Here, we start on a p, which immediately reads three implicit zeros from the empty stack and replaces itself with a null. This is the reason any solution will need two ps, because the rotation which starts with p immediately loses it before it can do anything useful. For this particular rotation, we immediately run into another p, which does nothing and then &haZYX pushes a ton of random numbers we're never going to use. Finally < moves us left and we basically move through the exact same code as in the unrotated source, except we don't have the additional p any more (but that only wrote a useless character to the second line anyway).
p&haZYX<p

This one behaves a bit differently. The initial p still removes itself, so the behaviour isn't really different until we hit < move back and push all the constants. However, now when reach the left end of the code, our actual p hasn't been executed yet, so the quine-printing code doesn't exist yet. The IP wraps around and we finally modify the source with the p at the end. Then the IP moves through ZYX again, uselessly pushing the constants again. Finally, we end on &ha just before the ".
String mode works such that it makes use of the iterator queue when leaving string mode. So what this does is that we end up pushing all of the grid codepoints to the stack 11 times instead of once. But since we're only working with the top 74 stack values anyway, we don't care about the other 10 copies at all and this rotation ends up working as well.
Next:
&haZYX<pp

This is basically the same, except we don't replace a p with null (but do write a rubbish character to the second line).
And finally, putting the rotation anywhere inside the code that pushes constants:
YX<pp&haZ

This isn't fundamentally different, we just push a smaller amount of rubbish to the stack before hitting the < and executing the proper code.

Welcome back!!!

The return of the legend, and with a huge answer like this, no less.

I'm flattered, but don't get your hopes up. ;)

Motorola MC14500B Machine Code, 1 byte
The 1 byte score is derived from two 4-bit instructions:
0000 0010

Explanation

The Motorola MC145008 is a single chip, one-bit, static CMOS processor optimized for decision-oriented tasks. The processor is housed in a 16-pin package and features 16 four-bit instructions. The instructions perform logical operations on data appearing on a one-bit bidirectional data line and data in a one-bit accumulating Result Register within the ICU. All operations are performed at the bit level.

The pins of the processor are numbered:

Instructions are presented to the chip on the 4 instruction pins, (I0, I1, I2, I3), and are latched into the Instruction Register, (IR), on the negative-going edge of X1.

In layman's terms, pins 4 through 7, are used to present the Instruction Register with an instruction, but the bits are interpreted in the reverse order. For example, the instruction 0001 would have pin #7 in the high state and pins 6 through 4 in the low state.

The instructions, are decoded in the Control Logic (CTL), sending the appropriate logic commands to the LU. Further decoding is also performed in the CTL to send a number of output flags (JMP, RTN, FLGO, FLGF) to pins 9 through 12. These are used as external control signals and remain active for a full clock period after the negative-going edge of X1.

Or, put simply, pins 9 through 12 are the output flags FLGF, FLGO, RTN, and JMP, respectively. Note that data is typically multiplexed to the WRITE pin (pin #2). The output flag pins are similar to other language's exit codes.

Each of the ICU's instructions execute in a single clock period.

Rotations
Initial position
0000    NOPO
0010    LDC

The clock periods:

The NOPO instruction puts pin #10 (FLGO) in the high state. Before the next clock period, the output flag pins are put back into the low state.
The LDC instruction loads the complement of the Data Bus' value to the Result Register, without affecting the output flag pins.

So, during the program's two clock periods, the output flag pins have represented 0100 0000, which, read in reverse (like the input pins), is 0000 0010, or the original instructions.
First rotation
0010    LDC
0000    NOPO

The clock periods:

The complement of the Data Bus is loaded to the Result Register, with no effect of the output flag pins.
Pin #10 in switched to the high state.

During these two clock periods, the output flag pins have represented 0000 0100, which, when reversed, are the instructions 0010 0000.

authors: Евгений Новиков


text:
Rotational symmetry of string
A rotation "is made by splitting a string into two pieces and reversing their order". An object is symmetrical under an operation if the object is unchanged after applying said operation. So, a "rotational symmetry" is the fact that a string remains unchanged after "rotation".
Given a non-empty string s consisting of only letters from a to z, output the highest order of the rotational symmetry of the string.
Testcases:
input        output
a            1
abcd         1
abab         2
dfdfdfdfdfdf 6

This is code-golf. Shortest answer in bytes wins. Standard loopholes apply.

Related.

previously asked as a CMC: http://chat.stackexchange.com/transcript/message/37509699#37509699

This is the same as finding the number of symmetric rotations smaller than the size of the string.  As @0' points out they form a cyclic group so finding the highest order is the same as finding the size of the group.  This would make the explanation of the task which is currently pretty unclear much clearer.

Retina, 15 bytes
(^.+?|\1)+$
$#1

Try it online!
Matches the entire string by repeating a substring (shorter substrings are prioritised due to the ungreedy .+?) and replaces the entire string with the number of repetitions we used.

Oh, of course, ungreedy. And here was me struggling with .*(.+)$(?<=^(\1)*)...

Jelly, 3 bytes
ṙJċ

Try it online!

Congratulations!

@LeakyNun That was your solution, right?

Indeed, it was.

Is your name a Gauntlet reference?

@user2357112 No it refers to outgolfing i.e. when you post a solution that's shorter than another posted solution.

It sounds a lot like Morak the Outsmarter from the NES version of Gauntlet.

05AB1E, 8 bytes
gGDÀ})QO

Try it online!
Explanation
gG  }      # len(input)-1 times do:
  D        # duplicate
   À       # rotate left
     )     # wrap result in a list
      Q    # compare each to input for equality
       O   # sum

Prolog (SWI), 64 bytes
A+B:-findall(X,(append(X,Y,A),append(Y,X,A)),[_|Z]),length(Z,B).

Try it online!
Defines a predicate +/2 that takes a string (in the form of a list of character codes) as its first argument (A) and sets its second argument (B) to the order of the highest order symmetric rotation.
Explanation
This program uses the fact that the set of symmetric rotations on a string are a cyclic group and so the order of the set of symmetric rotations is equal to the order of the highest order symmetric rotation. Thus the program is able to calculate the desired result by finding the total number of symmetric rotations on the input string.
Code Explanation
The majority of the heavy lifting is done by a call to the findall/3 predicate. The findall/3 predicate finds all the different possible values for the first argument (X in this case) such that the expression given as the second argument is true ((append(X,Y,A),append(Y,X,A)), more on that later). Finally it stores each of these possible values of X as a list in the final argument ([_|Z]).
The expression passed into findall/3 as the second arugment, (append(X,Y,A),append(Y,X,A)) uses the append/3 predicate to specify that X concatenated with some yet undefined Y must be equal to A, the input string, and that the same Y concatenated with X must also be equal to A. This means that X must be some prefix of A such that if it is removed from the front of A and added to the back then the resulting string is the same as A. The set of Xs with this property almost has a one-to-one correspondence with the symmetric rotations of A. There is always exactly one case of double counting which is caused by the fact that both the empty string and A are prefixes of A that correspond to the 0-rotation of A. Since the 0-rotation of A is always symmetric the length of the resulting list of Xs from findall/3 will be one greater than the number of symmetric rotations on A.
To solve the double counting problem, I use pattern matching on the third argument of the findall/3 predicate. In Prolog lists are represented as pairs of their head (the first element) and their tail (the rest). Thus [_|Z] represents a list whose tail is equal is equal to Z. This means that the length of Z is one less than the number of prefixes found by the findall/3 predicate and thus equal to the number of symmetric rotations of A. Finally, I use the length/2 predicate to set B to the length of Z.

Python, 31 bytes
lambda s:len(s)/(s+s).find(s,1)

Find the first nonzero index of s in s+s to figure out how far we have to rotate it to get s back, then divide the length of s by that number. Based on ideas I saw elsewhere.

JavaScript (ES6), 42 41 bytes
Saved 1 byte thanks to @l4m2
s=>s.length/s.match`(.+?)\\1*$`[1].length

Test cases

let f =

s=>s.length/s.match`(.+?)\\1*$`[1].length

console.log(f("a"))            // 1
console.log(f("abcd"))         // 1
console.log(f("abab"))         // 2
console.log(f("dfdfdfdfdfdf")) // 6

f=s=>s.length/s.match`(.+?)\\1*$`[1].length

Vyxal r, 4 bytes
żvǓO

Try it Online!
Port of Jelly answer.

Japt, 7 bytes
¬x@¥UéY

Test it online!
Explanation
 ¬ x@   ¥ UéY
 q xXY{ ==UéY}  // Expanded
Uq xXY{U==UéY}  // Variable introduction
                // Implicit: U = input string
Uq              // Split U into chars.
   xXY{      }  // Map each item X and index Y by this function, then sum the results:
       U==UéY   //   Return U equals (U rotated by Y characters).
                // Implicit: output result of last expression

Haskell, 49 bytes
g x=sum[1|a<-[1..length x],drop a x++take a x==x]

Try it online!
Haskell, 49 bytes
g x=sum[1|(a,_)<-zip[1..]x,drop a x++take a x==x]

Try it online!
Explanation
This uses the simple solution @0' pointed out.  Since the rotations of the string form a cyclic group the highest order element is the same as the size of the group thus we can get the order of the unit by finding the number of symmetric rotations.
The codes simple does a list comprehension and counts the number of rotations that preserve the original string.

You can use drop<>take instead of using (++) to save 3 bytes, like this.

@BMO (<>) isn't in prelude, in the version of Haskell I work with.

Factor, 42 38 bytes
[ dup all-rotations [ = ] with count ]

Try it online!
Count how many rotations of the input are equal to the input.

PHP, 66 Bytes
for(;strtr($a=$argn,[substr($a,0,++$i)=>""]););echo strlen($a)/$i;

Try it online!
PHP, 67 Bytes
preg_match('#^(.+?)\1*$#',$argn,$t);echo substr_count($argn,$t[1]);

Try it online!

C (gcc), 59 bytes
-Df(d,s)=for(d=n=strlen(s);n%d|memcmp(s,s+n/d,n-n/d);d--)

n;

Try it online!

tio should be suggested so the complier flags can be decided added into the code length

Suggest bcmp() instead of memcmp()


text:
Adding fractions
Write a program or a function that takes two non-empty lists of the same length as input and does the following:

uses elements of first list to get numerators,
uses elements of the second list to get denominators,
displays resulting fractions after simplification (2/4=>1/2), separated by "+"s,
displays "=" and result of addition after last fraction.

Example:
Input
[1, 2, 3, 3, 6]
[2, 9, 3, 2, 4]

Output
1/2+2/9+1+3/2+3/2=85/18

About rules

elements of lists will be positive integers,
elements can be separated by spaces, eg: 1/2 + 2/9 + 1 + 3/2 + 3/2 = 85/18 is ok,
trailing newline is allowed,
lists can be taken in other formats than above, eg.: (1 2 3 3 6) or {1;2;3;3;6}, etc.,
1 can be expressed as 1/1,
instead of printing you can return appropriate string,
you do not need to handle wrong input,
shortest code wins.

What range of values does it have to support?

@BradGilbertb2gills I would say at least -30 000 to 30 000, but then I don't know whether it would be extra problem for some languages. So maybe just standard integer range of your language of choice.

@PrzemysławP saying "standard integer range of your language of choice" is not a good idea, some languages have standard integer as booleans

Thank you! @BradGilbertb2gills Then at least -30 000 to 30 000.

Can we get fractions as [1, 2] [2, 9] [3, 3] ... instead?

@OlivierGrégoire No, sorry!

The standard integer range for Perl 6 is infinite, but the default range for denominators of Rationals is uint64.Range.max. So I was asking if I had to convert them all to FatRats instead.

@BradGilbertb2gills Sorry if I caused confusion - my second comment applies: -30 000 to 30 000.

can i concatenate the both lists as [1, 2, 3, 3, 6, 2, 9, 3, 2, 4] ?

@FelipeNardiBatista The input should be taken as two lists. After that you can obviously concatenate them.

Are the inputs going to be positive?

@Dennis Not always.

That should be reflected in the test cases.

@Dennis You are right. I'll add one more test case.

Can we assume the lists will always have at least two elements each?

@ScottMilner Yes.

@Dennis It looks like pretty much every solution assumed it's always positive integers so I think it's better to say that input should be only positive integer. Sorry for confusion:/

@BradGilbertb2gills Sorry again, but seeing that many people assumed input should be positive integers I think it's better to say that minimal supported range would be 1-30 000. Again, sorry for confusion:/

M, 12 11 bytes
÷µFj”+;”=;S

This is a dyadic link. Due to a bug, it doesn't work as a full program. F is also required due to a bug.
Try it online!
How it works
÷µFj”+;”=;S  Dyadic link. Left argument: N. Right argument: D

÷            Perform vectorized division, yielding an array of fractions (R).
 µ           Begin a new, monadic chain. Argument: R
  F          Flatten R. R is already flat, but j is buggy and has side effects.
   j”+       Join R, separating by '+'.
      ;”=    Append '='.
         ;S  Append the sum of R.

I like how more than a quarter of the program is to append the '='.  :)

Ruby 2.4, 54 53 characters
->n,d{a=n.zip(d).map{|n,d|n.to_r/d};a*?++"=#{a.sum}"}

Thanks to:

Value Ink for the Ruby 2.4 specific version (-3 characters)
Value Ink for optimizing the Rational initialization (-1 character)

Ruby, 58 57 56 characters
->n,d{t=0;n.zip(d).map{|n,d|t+=r=n.to_r/d;r}*?++"=#{t}"}

Sample run:
irb(main):001:0> puts ->n,d{t=0;n.zip(d).map{|n,d|t+=r=n.to_r/d;r}*?++"=#{t}"}[[1, 2, 3, 3, 6], [2, 9, 3, 2, 4]]
1/2+2/9+1/1+3/2+3/2=85/18

Try it online!

a=n.zip(d).map{|f|(f*?/).to_r};a*?++"=#{a.sum}" in Ruby 2.4 saves you 3 bytes.

Thanks @ValueInk. I suspected that may be possible, just had no 2.4 neither locally nor on TIO.

Yeah, I installed 2.4 specifically so I could test out solutions with sum haha. Also I just remembered that .map{|i,j|i.to_r/j} is shorter by 1 byte

Doh. I tried various approaches through .to_f and division, but didn't thought to dividing Rational with Fixnum. Thanks again, @ValueInk.

Mathematica, 33 bytes
Row@{Row[#/#2,"+"],"=",Tr[#/#2]}&

input

[{1, 2, 3, 3, 6}, {2, 9, 3, 2, 4}]

Isn't Row@@{#/#2,"+"} the same as Row[#/#2,"+"]?

yes! you are right!

Fantastic! I didn't realize Row was so convenient for things like this :)

Python 3, 104 bytes
9 bytes thanks to Felipe Nardi Batista.
from fractions import*
def f(*t):c=[Fraction(*t)for t in zip(*t)];print('+'.join(map(str,c)),'=',sum(c))

Try it online!

golfed a bit

@FelipeNardiBatista muito.

change +'='+str(sum(c)) to ,'=',sum(c)

@FelipeNardiBatista Thanks, also I've used Python 3 here (based on personal preference).

You can save a lot of bytes by switching to Python 2

At the cost of 5 bytes you can stay at python3: def f(*t):c=[*map(Fraction,*t)];print('+'.join(map(str,c)),'=',sum(c)) (93 bytes)

Perl 6,  77  73 bytes
{join('+',($/=[@^a Z/ @^b]).map:{.nude.join('/')})~"="~$/.sum.nude.join('/')}

Try it
{($/=[@^a Z/@^b])».nude».join('/').join('+')~'='~$/.sum.nude.join('/')}

Try it
Expanded:
{  # bare block lambda with two placeholder params ｢@a｣ and ｢@b｣

  (
    $/ = [              # store as an array in ｢$/｣ for later use

      @^a Z/ @^b        # zip divide the two inputs (declares them)

    ]

  )».nude\              # get list of NUmerators and DEnominators
  ».join('/')           # join the numerators and denominators with ｢/｣

  .join('+')            # join that list with ｢+｣

  ~
  '='                   # concat with ｢=｣
  ~

  $/.sum.nude.join('/') # get the result and represent as fraction
}

Clojure, 71 bytes
#(let[S(map / % %2)](apply str(concat(interpose '+ S)['=(apply + S)])))

Yay for built-in fractions!

Julia v0.4+, 66 53 bytes
-13 bytes thanks to Dennis
a^b=replace(join(a.//b,"+")"=$(sum(a.//b))","//","/")

Try it Online!
Alternately, if fractions can be displayed using // rather than /, the following works for 35 bytes:
a^b=join(a.//b,'+')"=$(sum(a.//b))"

Mathematica, 61 bytes
t=#~ToString~InputForm&;Riffle[t/@#,"+"]<>"="<>t@Tr@#&[#/#2]&

JavaScript (ES6), 111 bytes
Takes the lists in currying syntax (a)(b).

let f =

a=>b=>a.map((v,i)=>F(A=v,B=b[i],N=N*B+v*D,D*=B),N=0,D=1,F=(a,b)=>b?F(b,a%b):A/a+'/'+B/a).join`+`+'='+F(A=N,B=D)

console.log(f([1, 2, 3, 3, 6])([2, 9, 3, 2, 4]))

Java, 225 bytes
int c(int a,int b){return b>0?c(b,a%b):a;}
(N,D)->{int n=0,d=1,i=0,g;String s="";for(;i<N.length;g=g(N[i],D[i]),N[i]/=g,D[i]/=g,s+=(i>0?"+":"")+N[i]+"/"+D[i],n=n*D[i]+N[i]*d,d*=D[i++],g=g(n,d),n/=g,d/=g);return s+"="+n+"/"+d;}

N and D are both int[], contextualized.
I reused Kevin Cruijssen's GCD function.
See it and test it online!

setlX, 103 bytes
f:=procedure(a,b){i:=1;l:=[];while(i<=#a){l:=l+[a[i]/b[i]];i+=1;}s:=join(l,"+");return s+"="+eval(s);};

Creates a function called f where your insert two lists.
ungolfed:
f := procedure (a,b) {
    i:=1;
    l:=[];
    while(i<=#a){
        l:=l+[a[i]/b[i]];
        i+=1;
    }
    s:=join(l,"+");
    return s+"="+eval(s);
};

with named variables and annotations:
setlX doesn't provide a comment feature so let's just pretend that we can comment with %
f := procedure(firstList,secondList) {
    count := 1;
    list := [];
    while(count <= #firstList) {
        % calculate every fraction and save it as a list
        list := list + [firstList[count]/secondList[count]];
        count += 1;
    }
    % Seperate every list entry with a plus ([2/3,1] -> "2/3+1")
    str := join(list, "+");
    % eval executes the string above and thus calculates our sum
    return str + "=" + eval(str);
};

What if #firstList is different from #secondList?

you mean differnet size? The question states that first list is used by enumerator and wrong input can be ingored

but other than that: if the second list is longer, the remaining entries will be ignored. If the list is shorter a runtime error will occur.

Jelly, 31 bytes
,:gj”/
ṙJ$ṖP×Sç⁸P¤,ç@"j”+$¥Ṛj”=

Try it online!

F#, 244 241 239 bytes
let rec g a=function|0->abs a|b->g b (a%b)
let h a b=g a b|>fun x->a/x,b/x
let s,n,d=List.fold2(fun(s,n,d)N D->
 let(N,D),(n,d)=h N D,h(n*D+N*d)(d*D)
 s@[sprintf"%i/%i"N D],n,d)([],0,1)nom div
printf"%s=%i/%i"(System.String.Join("+",s))n d

Try it online!

05AB1E, 35 34 bytes
‚øvyy¿÷'/ý'+}¨'=¹.¿©¹÷²*O®‚D¿÷'/ýJ

Try it online!

PHP>=7.1, 190 Bytes
<?function f($x,$y){for($t=1+$x;$y%--$t||$x%$t;);return$x/$t."/".$y/$t;}[$n,$d]=$_GET;for($p=array_product($d);$x=$n[+$k];$e+=$x*$p/$y)$r[]=f($x,$y=$d[+$k++]);echo join("+",$r)."=".f($e,$p);

Online Version
+14 Bytes for replacement return$x/$t."/".$y/$t; with return$y/$t>1?$x/$t."/".$y/$t:$x/$t; to output n instead of n/1

setlX, 62 bytes
[a,b]|->join([x/y:[x,y]in a><b],"+")+"="++/[x/y:[x,y]in a><b];

ungolfed:
[a,b]|->                  define a function with parameters a and b
  join(
    [ x/y :               using set comprehension, make a list of fractions
      [x,y] in a><b       from the lists zipped together
    ],
    "+"
  )                       join them with "+"
  + "="                   concat with an equals sign
  +                       concat with
  +/[x/y:[x,y]in a><b]    the sum of the list
;

Haskell (Lambdabot), 94 91 86 bytes
t=tail.((\[n,_,d]->'+':n++'/':d).words.show=<<)
a#b|f<-zipWith(%)a b=t f++'=':t[sum f]

Try it online!
Thanks @Laikoni for -8 bytes!
Ungolfed
-- convert each fraction to a string (has format "n%d", replace '%' with '/' and prepend '+' ("+n/d"), keep the tail (dropping the leading '+')
t = tail.((\[n,_,d]->'+':n++'/':d).words.show=<<)
-- build a list of fractions
a # b = let f = zipWith(%) a b in
-- stringify that list, append "=" and the stringified sum of these fractions
  t f ++ "=" ++ t [sum f]

Your missing a import Data.Ratio for % which is not in Prelude.

You can save some bytes by replacing "?"++ with '?':.

Whoops, totally missed that.. Thanks! Yup, fixed.

The shortening also works for "/"++d and "="++.

Yeah, I just noticed.. But only for "="++ :S

Rearranging saves some more bytes: tail(f>>=t)++'=':(tail.t.sum)f

Putting tail and =<< into t saves some more: Try it online!

Neat, I like how you did [sum f] to pull out the tail. Thanks a lot!

Google Sheets, 83 81 bytes
=ArrayFormula(JOIN("+",TRIM(TEXT(A:A/B:B,"?/???")))&"="&TEXT(sum(A:A/B:B),"?/???"

Saved 2 bytes thanks to Taylor Scott
Sheets will automatically add 2 closing parentheses to the end of the formula.
The two arrays are input as the entirety of columns A and B. Empty rows below the inputs will throws errors.

you should be able to drop 2 bytes by dropping the terminal ))

R, 109 bytes
f=MASS::fractions;a=attributes
g=function(n,d)paste(paste(a(f(n/d))$f,collapse='+'),a(f(sum(n/d)))$f,sep='=')

requires the MASS library (for its fractions class). the function g returns the required output as a string.
Try it online! (R-fiddle link)

TI-BASIC, 100 bytes
:L₁⁄L₂                                              //Creates a fraction from Lists 1 & 2, 7 bytes
:toString(Ans→Str1                                  //Create string from list, 7 bytes
:inString(Ans,",→A                                  //Look for commas, 9 bytes
:While A                                            //Begin while loop, 3 bytes
:Str1                                               //Store Str1 to Ans, 3 bytes
:sub(Ans,1,A-1)+"+"+sub(Ans,A+1,length(Ans)-A→Str1  //Replace "," with "+", 33 bytes
:inString(Ans,",→A                                  //Check for more commas, 9 bytes
:End                                                //End while loop, 2 bytes
:Str1                                               //Store Str1 to Ans, 3 bytes
:sub(Ans,2,length(Ans)-2                            //Remove opening and closing brackets, 13 bytes
:Ans+"="+toString(expr(Ans                          //Add "=" and answer, 11 bytes

Note the ⁄ at the beginning, different from /. This makes the fractions hold their forms. It does work with negative fractions.
Sigh. TI-BASIC is horrible with strings. If all we had to do was print the fractions, and then their sum, the code would be:
TI-BASIC, 12 bytes
:L₁⁄L₂    //Create fractions from lists, 7 bytes
:Disp Ans //Display the above fractions, 3 bytes
:sum(Ans  //Display the answer, 2 bytes

That means that 88 bytes of my code is spent just formatting the answer! Hmph.

Perl 6, 72 bytes 65 bytes
Native and automatic rationals should make this easy, but default stringification is still as decimal, so we have to .nude (numerator and denominator) which kills our score and makes the 1 ugly :(
my \n = 1,2,3,3,6; my \d = 2,9,3,2,4;
(n Z/d)».nude».join("/").join("+")~"="~([+] n Z/d).nude.join("/")

Update: Removed unneeded brackets, kill more space and use smarter map. Saves characters over Brad's solution at the cost of no not being a lambda sub.

Welcome to the site! Nice first answer!

MATL, 32 bytes
/YQv'%i/%i+'wYD3L)61yUYQVwV47b&h

Try at MATL online!
Explanation
Consider [1, 2, 3, 3, 6], [2, 9, 3, 2, 4] as input.
/         % Implicit inout. Divide element-wise
          % STACK: [0.5 0.222 1 1.5 1.5]
YQ        % Rational approximation (with default tolerance)
          % STACK: [1 2 1 3 3], [2 9 1 2 2]
v         % Conctenate all stack elements vertically
          % STACK: [1 2; 2 9; 1 2; 3 2; 3 2]
'%i/%i+'  % Push this string (sprintf format specifier)
          % STACK: [1 2; 2 9; 1 2; 3 2; 3 2], '%i/%i+'
wYD       % Swap, sprintf
          % STACK: '1/2+2/9+1/1+3/2+3/2+'
3L)       % Remove last entry
          % STACK: '1/2+2/9+1/1+3/2+3/2'
61        % Push 61 (ASCII for '=')
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61
y         % Duplicate from below
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, '1/2+2/9+1/1+3/2+3/2'
U         % Evaluste string into a number
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, 4.722
YQ        % Rational approximation
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, 85, 18
VwV       % Convert to string, swap, convert to string
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, '18', '85'
47        % Push 47 (ASCII for '/')
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, '18', '85', 47
b         % Bubble up in stack
          % STACK: '1/2+2/9+1/1+3/2+3/2', 61, '85', 47, '18'
&h        % Concatenate all stack elements horizontally. Implicitly display
          % STACK: '1/2+2/9+1/1+3/2+3/2=85/18'

C, 171 bytes
Try Online
i;t;x;y;f(int s,int*a,int*b){x=*a;y=*b;while(++i<s)x=(y-b[i])?(x*b[i])+(a[i]*y):(x+a[i]),y=(y-b[i])?(b[i]*y):y;for(i=1;i<=(x<y?x:y);++i)t=(x%i==0&&y%i==00)?i:t;x/=t;y/=t;}

Axiom, 212 bytes
C==>concat;S==>String;g(a)==C[numerator(a)::S,"/",denom(a)::S];h(a:List PI,b:List PI):S==(r:="";s:=0/1;#a~=#b or #a=0=>"-1";for i in 1..#a repeat(v:=a.i/b.i;s:=s+v;r:=C[r,g(v),if i=#a then C("=",g(s))else"+"]);r)

test
(5) -> h([1,3,4,4,5,6], [2,9,5,5,6,7])
   (5)  "1/2+1/3+4/5+4/5+5/6+6/7=433/105"
                                                             Type: String
(6) -> h([1,3,4,4], [2,9,5,5,6,7])
   (6)  "-1"
                                                             Type: String

Casio Basic, 161 Bytes
Dim(List 1)->A
for 1->I to A step 1
3*I-2->B
List 1[I]->C
List 2[I]->D
locate 1,B,C
locate 1,B+1,"/"
locate 1,B+2,D
C/D+E->E
next
locate 1,B+3,"="
locate 1,B+4,E

Explanation:

Number of input is saved in A
A iterations
B acts as a counter for correct displaying
I'th item of List 1 and 2 saved in C and D
Displaying of Variable C / Variable D
save C/D+E in E
After last number locate = and E

Vyxal Ṫ, 12 bytes
/₌≬vS\+j∑\=$

Try it Online!
10 bytes of this is just getting the formatting right... /:
Explained
/₌≬vS\+j∑\=$
/           # divide the lists, vectorising
 ₌≬vS\+j     # join each fraction on "+" (there's a bug where they get converted to decimal without vS :/)
       ∑    # get the sum of the fractions.
        \=$ # place a "=" between the two
            # the Ṫ flag prints the entire stack without spaces. If it wasn't for the aforementioned joining bug, the last $ could be a j and the flag wouldn't be needed.


text:
Was this bite mine?
Yesterday, I left my sandwich on the table. When I got up today, there was a bite in it... Was it mine? I can't remember...
Problem:
Take a representation of the sandwich and my bite pattern and tell me if it was my bite or not.
Examples:
Example 1:
My bite pattern:
..
.

Sandwich:
#####
.####
..###

Output:
truthy

Example 2:
My bite pattern:
..
..

Sandwich:
...##
..###
.####

Output:
falsy

Example 3:
If there is at least 1 rotation that counts as truthy, the output is truthy.
My bite pattern:
.
 .
  .

Sandwich:
##.
#.#
.##

Output:
Two possible rotations (biting in the northeast or southwest corner).
truthy

Some valid bites:
..
.

...
.
.

.
 .
  .

..
. .
 ..

 ..
.
. .

Some invalid bites:
..

...
.

..
.
 .

Rules:

My bite pattern orientation will always be for biting the northwest corner. And must be rotated to bite other corners;
There will always be 1 and only 1 bite in the sandwich;
The bite in the sandwich can be in any of the 4 cornes (rotated accordingly);
Bite patterns will always be symmetrical along the main diagonal;
Bite patterns will always be at least 1 wide and non empty;
The sandwich will always be a rectangle with width and height equal or greater than the width of my bite pattern;
In your input, you can choose any 2 distinct non-whitespace characters to represent the sandwich and the bite;
Spaces in the bite pattern means that my bite does not touch that part of the sandwich.

Can the bite pattern be larger than the sandwich? Can the bite pattern be empty? Can the bite pattern be the same as the sandwich? i.e. .., ..?

@TheLethalCoder the rules say the bite pattern will always fit the sandwich. i'll add a new rule to specify minimum size (1 width)

@TheLethalCoder and yes, the bite pattern can be the same as the sandwich

Ruby, 103 bytes 101 bytes
->b,s{[a=s.map(&:reverse),s,s.reverse,a.reverse].any?{|t|b.zip(t).all?{|y,x|y==x.tr(?#,' ').rstrip}}}

Try it online!
Saved 2 bytes by moving the assignment to the first use of a.
Apparently Ruby is smart enough to not confuse the commas in the array definition and commas that would arise from simultaneous variable assignment (at least in this case :D)

Python 2, 134 bytes
b,s=input()
a=[''.join(l[::-1])for l in s]
print any(b==[l.replace('#',' ').rstrip()for l in x][:len(b)]for x in(a,a[::-1],s[::-1],s))

Takes input as two lists of strings (one for each line). Assumes no trailing whitespace on the lines.
Try it online!
Examples:
Input: ['..','.'],['#####','.####','..###'] (example 1)
>True

Input: ['..','..'],['...##','..###','.####'] (example 2)
>False

Input: ['',' .'],['#####','#.###','#####'] (no bite in top row)
>True

Python 2, 173 bytes
Try it online
S,b=input()
L=len
B=map(lambda x:[y<'.'and'#'or y for y in x]+['#']*(L(S[0])-L(x)),b+[[]]*(L(S)-L(b)))
R=map(lambda x:x[::-1],B)
print S==B or S==B[::-1]or S==R[::-1]or S==R

Takes input as two lists of lists of characters.
First - sandwich
Second - bite
First it extends bite array to the size of sandwich array:
B=map(lambda x:[y<'.'and'#'or y for y in x]+['#']*(L(S[0])-L(x)),b+[[]]*(L(S)-L(b)))

[y<'.'and'#'or y for y in x] replaces all spaces to #
(L(S[0])-L(x)),b+[[]]*(L(S)-L(b)) calculates the number of missing element
Then it compares all 4 rotation of this "extended" bite to the sandwich:
R=lambda:map(lambda x:x[::-1],B)
print S==B or S==B[::-1]or S==R()or S==R()[::-1]
print any(map(S.__eq__,[B,B[::-1],R(),R()[::-1]])) #longer but pretty

lambda R is used to mirror list of lists horizontally
In the linked example sandwich is:
##.
#.#
###

And bite is:
.
 .

why R=Lambda:map... and not R=map...

@FelipeNardiBatista Because I missed it :D Thanks!

B=[[y<'.'and'#'or y for y in x]+['#']*(L(S[0])-L(x))for x in b+[[]]*(L(S)-L(b))] for -4

And R=[x[::-1]for x in B] for -4 as well. In general, don't use map with a lambda function


text:
How long is my number: Restricted Version
Find the original challenge here
Challenge
Given an integer, Z in the range -2^31 < Z < 2^31, output the number of digits in that number (in base 10).
Rules
You must not use any string functions (in the case of overloading, you must not pass a string into functions which act as both string and integer functions). You are not allowed to store the number as a string.
All mathematical functions are allowed.
You may take input in any base, but the output must be the length of the number in base 10.
Do not count the minus sign for negative numbers. Number will never be a decimal.
Zero is effectively a leading zero, so it can have zero or one digit.
Examples
Input > Output

-45 > 2
1254 > 4
107638538 > 9
-20000 > 5
0 > 0 or 1
-18 > 2

Winning
Shortest code in bytes wins.

I assume no array functions either?

@Cyoce Yes, no array functions

So if a language only accepts input as a string, it's invalid for this challenge, right?

@EngineerToast Yes, very much so

I'm removing the restricted source tag because while this is a restriction it is not a real source restriction in that it is not computer tractable.

Mathematica, 13 bytes
IntegerLength

Well...

According to https://codegolf.meta.stackexchange.com/a/3605/14732 this makes this question a duplicate.

@IsmaelMiguel Well, this is a slightly trickier case, because the challenge is effectively a duplicate in some languages but not at all on others.

Most answers there can be just copied over to here.

@IsmaelMiguel I'd have to go and count, but I believe the majority of answers on the previous challenge used string processing which is not an option here.

Meh, I lost the count 3 times. But seems to actually be around 30-45% of the answers. Those can be just copied over.

Python 2, 30 bytes
f=lambda x:x and-~f(abs(x)/10)

Try it online!

@Notts90 I do, because it is referenced inside.

Japt, 5 3 bytes
ì l

Try it online!

I pushed a fix that makes the a unnecessary -- 5 minutes before the challenge was posted :-) Unfortunately, that means it'll only work on the online interpreter. (test it online!)

Awesome. Well done ninja'ing the question ; )

JavaScript (ES6), 19 bytes

f=n=>n&&f(n/10|0)+1

console.log(f(-45))       // 2
console.log(f(1254))      // 4
console.log(f(107638538)) // 9
console.log(f(-20000))    // 5
console.log(f(0))         // 0
console.log(f(-18))       // 2

do we count "f="? lots of the other languages here present the function definition by itself.

@Sparr This is a recursive function that references itself. So in this special case, yes, we count f=.

My answer from the other challenge still works:
Brachylog, 1 byte
l

Try it online!
The l builtin is overloaded, but on integers, it takes the number of digits of the integer, ignoring sign.

Jelly, 3 2 bytes
1 byte saved thanks to Leaky Nun
DL

Try it online!
Explanation
 L    Length of
D     Decimal expansion of input argument. Works for negative values too

DL?

I was trying to do this. But I couldn't find what I needed on the code page :(

"length" of an integer, using the same function that gives the length of a string, really feels like a string function...

Not lenght of an integer, but of a list of its digits (obtained with D). The challenge says: in the case of overloading, you must not pass a string into functions which act as both string and integer functions This answer follows that rule: I'm not passing a string

APL (Dyalog Unicode), 7 bytes
⌈10⍟1+|

Try it online!
Explanation:
⌈10⍟1+|
⌈        ⍝ round up the
 10⍟     ⍝ log10 of...
    1+   ⍝ incremented
      |  ⍝ absolute value of input

If format is allowed: 4 bytes - ≢⍕∘|

≢10∘⊤ in Extended, if you are so inclined.

dc, 1 byte
Z

Try it online!

Not using a builtin, 18 bytes:
[d10/d0!=F]dsFxz1-

Try it online!

Java 8, 61 59 39 37 33 bytes
n->(int)Math.log10(n<0?-n:n+.5)+1

-4 bytes thanks to @MarkJeronimus.
Try it online.
Explanation:
n->            // Method with integer as both parameter and return-type
  (int)        //  Convert the following double to an integer (truncating its decimals):
    Math.log10(//   The log_10 of:
      n<0?     //    If the input is negative:
          -n   //     Use its absolute value
         :     //    Else:
          n+.5)//     Add 0.5 to the input instead
  +1           //  And add 1 to the result at the end

33: n->(int)Math.log10(n<0?-n:n+.5)+1

@MarkJeronimus Thanks! :)

Alice, 16 bytes
/O
\I@/Hwa:].$Kq

Try it online!
Explanation
/O
\I@/...

This is simply a framework for numerical input→mathematical processing→numerical output.
The rest of the code is the real algorithm:
Hwa:].$Kq
H            Compute absolute value
 w   .$K     While the result is not zero do:
  a:           divide the number by 10
    ]          move the tape head one cell forward
        q    Get the position of the tape head

Chaincode, 5 bytes
pqL_+

Note: This is exactly the same code as that from the other challenge
Explanation
pqL_+ print(
    +   succ(
   _      floor(
  L        log_10(
pq           abs(
               input())))))

R, 40 bytes
function(x)max(ceiling(log10(abs(x))),0)

Try it online!

I realize it's been 3 years, but here's a 38 byte version.

Pip, 14 bytes
LNABq/LNt//1+1

https://tio.run/##K8gs@P/fx8/RqVDfx69EX99Q2/D/f0MDczNjC1NjCwA
Explanation
LN              natural log of...      (change of base becasue this is the only log function they had)
  ABq           the absolute value of the input...
     /          divided by...
      LNt       the natural log of 10...   (change of base)
         //1    integer divided by 1 (no floor function)
            +1  added to 1

This was inspired by the Chaincode solution.
This could probably be optimized.

Welcome to Code Golf, nice first answer!

C, 27 bytes
Try Online
f(n){return n?1+f(n/10):0;}

C (gcc), 22 bytes
f(n){n=n?1+f(n/10):0;}

Using math, 29 bytes
f(n){return 1+log10(abs(n));}

S.I.L.O.S, 41 bytes
readIO
i|
lblb
i/10
a+1
if i b
printInt a

Try it online!
Returns 1 for 0.

Why is there no love for SILOS, its golfier than python for this challenge!

Lua, 40 bytes
Port from my python answer
print(math.log10(math.abs(10*...)+1)//1)

Try it online!

K (ngn/k), 10 9 7 bytes
-3 bytes from @ngn (see Am I an insignificant array?)
#10\#!:

Try it online!

#!: get the absolute value of the input (literally, take the count of the range of each value; e.g. #!-2 -> #-2 -1 -> 2)
10\ "digit-ize" the input
# take the count

A solution using $ instead of 10\ save two bytes, but may be invalid given the question's rules.

-1 byte: #10\|/-:\

Thanks, very neat use of monadic scan/converge!

ARM Thumb-2 (no div instruction, no libgcc), 30 bytes
Raw machine code:
2800 d00b bfb8 4240 2201 2100 3101 380a
dafc 3201 0008 280a daf7 0010 4770

Uncommented assembly:
        .syntax unified
        .globl count_digits
        .thumb
        .thumb_func
count_digits:
        cmp     r0, #0
        beq     .Lret
        it      lt
        neglt   r0, r0
        movs    r2, #1
.Lcountloop:
        movs    r1, #0
.Ldivloop:
        adds    r1, #1
        subs    r0, #10
        bge     .Ldivloop
.Ldivloop_end:
        adds    r2, #1
        movs    r0, r1
        cmp     r0, #10
        bge     .Lcountloop
.Lcountloop_end:
        movs    r0, r2
.Lret:
        bx      lr

Returns 0 if 0.
Explanation
C function signature:
int32_t count_digits(int32_t val);

First, we compare val to zero.
If it is zero, we return zero. If it is less than zero, we negate it.
count_digits:
        cmp     r0, #0
        beq     .Lret
        it      lt
        neglt   r0, r0

Set up our digit counter for the outer loop.
        movs    r2, #1

Now, a naïve subtraction based division loop
        movs    r1, #0
.Ldivloop:
        adds    r1, #1
        subs    r0, #10
        bge     .Ldivloop

Increment the digits counter, then loop to the outer loop if we are still more than 10.
.Ldivloop_end:
        adds    r2, #1
        movs    r0, r1
        cmp     r0, #10
        bge     .Lcountloop

Move the result into the return register and return.
.Lcountloop_end:
        movs    r0, r2
.Lret:
        bx      lr

Julia, 7 bytes
ndigits

Try it online!

PowerShell Core, 46 bytes
param($a)for($s=0;$a){$s+=!!($a=[int]$a/10)}$s

Implementation Details
param($a)              # Defines the input parameter
for($s=0;$a){          # Initialise the result to 0 and iterates while the parameter is not 0
$s+=!!($a=[int]$a/10)  # Divides the parameter by 10 and increment the result variable
                       # by one if the result is not 0
}$s                    # Returns the result

Try it online!

Excel, 26 bytes
=INT(LOG(A1^2+(A1=0))/2)+1

Log of the number squared / 2 is 1 byte shorter than ABS

TI-Basic, 9 8 bytes
int(log(1+10abs(Ans

Takes input in Ans.
-1 byte thanks to MarcMush.

int(log(1+10abs(Ans

Python 2, 48 bytes
-3 thanks to ovs
-1 thanks to pizzapants
lambda x:math.log10(abs(10*x)+1)//1
import math

Try it online!

lambda x:1+log10(abs(x)+.1)//1 for 48 bytes

import math and math.log10 saves one byte

05AB1E, 6 bytes
Ä>T.nî

Try it online! or Try all tests
Ä      # Absolute value
 >     # Increment
  T.n  # Log base 10
     î # Round up

Ä>T.nî

C#, 49 56 bytes
namespace System.Math{n=>n==0?1:Floor(Log10(Abs(n))+1);}

Jelly, 5 bytes
A‘l⁵Ċ

Try it online!

Ruby, 27 bytes
f=->x{x==0?0:1+f[x.abs/10]}

As a test:
tests = [[-45 , 2],
         [1254 , 4],
         [107638538 , 9],
         [-20000 , 5],
         [0 , 0 ],
         [-18 , 2]]

tests.each do |i, o|
  p f.call(i) == o
end

It outputs:
true
true
true
true
true
true

Perl 5 -Minteger -p, 26 24 bytes
1while++$\*abs($_/=10)}{

Try it online!

@yBASIC, 53 bytes.
_#=@_>.@_
_%=_%/(_#*_#+!.)_=_+!.GOTO(@_)+"_"*!_%@__?_

Input should be stored in variable _%

Rust, 41 bytes
fn f(n:i32)->u8{n!=0&&return f(n/10)+1;0}

Try it online!

Welcome to PPCG.

Pyth, 10 bytes
.xhs.l.aQT

Test suite
Explanation:
.xhs.l.aQT  # Code
.xhs.l.aQTQ # With implicit variables
            # Print (implicit):
    .l   T  #   the log base 10 of:
      .aQ   #    the absolute value of the input
   s        #   floored
  h         #   plus 1
.x        Q #  unless it throws an error, in which case the input

Python 3 translation:
import math
Q=eval(input())
try:
    print(int(math.log(abs(Q),10))+1)
except:
    print(Q)

Gol><>, 12 bytes
SA:z+aSLS(PB

Try it online!
Example full program & How it works
1AGIE;GN
SA:z+aSLS(PB

1AGIE;GN
1AG       Register row 1 as function G
   IE;    Take input as int, halt if EOF
      GN  Call G and print the result as int

SA:z+aSLS(PB
SA            Absolute value
  :z+         Add 1 if zero
     aSL      Take log 10
        S(    Floor
          PB  Increment and return

Many math functions are prefixed with S, which made the code longer.
Adding 0.9 unconditionally (9a,+) and using ceiling (S)) is also possible with same byte count. Zero input yields 0 in this case.

AWK, 33 bytes
$1=int(log(($1?$1^2:1)^.5)/2.3)+1

Try it online!
Basically, this will print the integer part of the log base 10 of the input, plus one. 2.3 is a working approximation of natural log of 10. To deal with negative numbers, it takes the square root of the power of two. If input is zero, returns 1 instead, so the pattern is different from 0, which would return false and would not be printed. Too many necessary workarounds.

R, 38 bytes
f=function(x)`if`(x^2<100,1,1+f(x/10))

Try it online!
Unusually for R, a recursive function seems to be shorter here than the previous answer using built-in functions (although this is mostly gained simply because we can skip abs(x) by using x^2<100 as a condition instead)...

Make, 80 bytes
$(N):
ifeq ($(N),0)
	@echo 0
else
	@expr 1 + $(shell make N=$$(($(N)/10)))
endif

Try it online!
I'm posting this entry for two reasons...
First, it's a ridiculous way to get the number of digits. :)  It's recursively calling make, each time dividing the number by 10, and counting how many time that happens.
Second, it works on my Linux test system from the commandline (which is using GNU Make 4.1) but will not work at all on TIO (which appears to be using GNU Make 4.2.1).  So I'm really curious about that and would like to know if it works for other people?  It might just be that I don't know how to translate things like:
~/work/code-golf$ make N=888
3

to TIO's input format syntax?

I'm also not sure about how exactly arguments are managed by TIO, but you can make it work with bash: Try it online!

Factor, 26 bytes
[ abs log10 >integer 1 + ]

Try it online!

Vyxal, 5 bytes
ȧ›∆τ⌈

Try it Online!
Thanks to the 05AB1E answer for providing me with an algorithm to port.
Explained
ȧ›∆τ⌈
ȧ›      # abs(input) + 1
  ∆τ    # log_10(↑)
    ⌈   # ceil(↑)

Thunno 2, 5 bytes
A⁺Ælṃ

Try it online!
A⁺Ælṃ  # Implicit input
A      # Absolute value
 ⁺     # Increment it
  Æl   # Log base 10
    ṃ  # Ceiling
       # Implicit output

Japt v2.0a0, 3 2 bytes
Split on each number and get the length. Is this ok? I'm not using any string method implicitly
thanks @The Empty String Photographer
ìl

Try it

You don’t need the space for some strange reason…

Raku, 25 bytes
{0 max.abs.log10.floor+1}

Try it online!

Uiua, 7 bytes
⌈ₙ10+1⌵

Try it!
⌈ₙ10+1⌵
      ⌵  # absolute value
    +1   # increment
 ₙ10     # log base ten
⌈        # ceiling

QBIC, 25 bytes
≈abs(:)>=1|b=b+1┘a=a/z}?b

This divides the input by 10, and keeps track of how many times we can do this until N < 1.
Explanation:
≈abs(:)>=1| : gets cmd line input,
            ≈ starts a while loop,
            abs() is literal QBasic code and is for cases with negative n
            | is the terminator to the WHILE-condition
b=b+1       Keep track of the # of divisions
┘           Syntactic line break
a=a/z       Divide a by 10 (z==10 in QBIC)
}           End WHILE-loop body
?b          PRINT b

Bash, 50 bytes
a=$1;until [ $a -eq 0 ];{ let i++ a=a/10;};echo $i

Try it online!
No string/array command, only count digits by integer division.

Ruby, 33 bytes
->x{1+Math.log10(x.abs+0.1).to_i}

Try it online!

bc, 6 bytes
length

Built-in function.

Actually, 8 bytes
;0=+A╥Lu

Try it online!
Explanation:
;0=+A╥Lu
;0=       is input equal to 0?
   +      add 1 if input is 0, else add 0
    A     absolute value
     ╥L   log base 10, floor
       u  increment

This program effectively calculates floor(log10(x))+1. To deal with log(0) being undefined (actually it returns (-inf+nanj) which is a special way of saying it's undefined), the input is incremented if it is 0 prior to computing the length. Thus, 0 is considered to have a length of 1.

Pari/GP, 13 bytes
n->#digits(n)

Try it online!

MATL, 5 bytes
|OYAn

Try it online!
Explanation
|     % Implicitly input a number. Absolute value
OYA   % Convert to array of decimal digits
n     % Length. Implicitly display

PowerShell, 52 51 Bytes
$m=[math];$m::Floor($m::Log10($m::Abs($args[0])))+1

Thanks to Felipe for both fixing the Issue with Log10, and providing a 1byte save.
Any System.Math calls are extremely expensive in PowerShell.
Uses the method of getting the Log10 of the Abs Value of the input, and rounding that up.

you should use Floor()+1. Ceil() fails for for powers of 10

use $m::Log10(... to save a byte

Octave, 27 bytes
@(x)fix(log10(abs(x+~x)))+1

Try it online!

PHP, 23 Bytes
<?=-~log10(abs($argn));

Try it online!

jamforth, 6 bytes
UWIDTH

I'm not sure why gforth doesn't have UWIDTH. It's actually really useful.
This solution also works in arbitrary bases.

Vyxal l, 1 byte
ȧ

Try it Online!
This is why restricting built-ins is a bad idea. The l flag outputs the length of the top of the stack implicitly, which I don't think is a "function" - it's a feature of the language variant, not a function.
The ȧ simply gets the absolute value because - is counted in the size.