# Tag Info

15

Python by Sisyphus for Is this number a prime? $110728750366081 = 37 \times 41 \times 71 \times 661 \times 673 \times 2311$ is wrongly recognized as a prime. Try it online! Sisyphus implemented the Solovay-Strassen primality test, which is based on a theorem by Euler which states for any prime number $p$ and any integer $a$:  a^{p-1\over2} \equiv \...

9

Python 3, score: 11069 10495 This algorithm is very slow but I'm pretty sure it's close to optimal depending on the parameters MIN_SPLINTER_SIZE and MAX_SPLINTER_SIZE, though it takes quite long even when only set to 2, 120 import sys import dataclasses @dataclasses.dataclass class Splinters: """ The splinters class is the basic ...

7

Jelly by caird coinheringaahing for Is it double speak? ṾḊṖŒœE Try it online! Uneval doesn't always surround the string in quotes. Since Jelly cannot escape string delimiters (and even if it could, the escape characters would cause it to fail), ““ unevaluates to ”“,”“ (literal character “ followed by literal character “), which is not even an even-length ...

6

Jelly, 76 bytes, score 8611 ṡĠị$ḢṭFL’×ʋ¥LƊ€ɗⱮ20Ẏ1ị>3ƲƇḢÐṀṪṪ ”\;ⱮØ{jWƊ};"œṣɗj¹;@ɗ‘ɼịØA¤ɗŻṛ?Ç$1ịȧ®<26¤Ʋ¿ḟ0 Try it online! A full program taking a string and printing the Splinter program. The TIO link can be used for all 9 required test cases by modifying the first argument from 1 to 9 for the relevant case. We're no strangers to love -> 997 I ...

4

Python 2, 37 bytes (+830 char output = 867) f=lambda n:2/n*"0"orn%2*10+f(-~n/2) Try it online! 0 for double, 1 for decrement, in reversed order. -1 byte thanks to dingledooper for the base case. Python 2, 39 bytes lambda n:bin(n-1)[2:].replace('0','10') Try it online! 1 for double, 0 for decrement

4

Vyxal K, 864 bytes, A-Z The K flag treats numbers as ordinal values when printing them, so for everything except the string and character literals, we just need to get the right number, and it gets converted to a character automatically. Note: Space is shown used twice, but that is only for readability. The link for X has the spaces replaced with newlines. ₄₄...

4

Rust, 65540 bytes */"##### ... a lot more #s ... ### That is, a newline followed by */" followed by 65535 #s followed by a backtick. In rust, the only way to come at this challenge is to break out of any comments or strings, and then cause a syntax error. The comments are easy, line comments are defeated with the newline and multiline comments ...

3

Charcoal, 11 bytes, score 841 ⭆↨⊖Ｎ²…x-⁻²ι Try it online! Link is to verbose version of code. Explanation: Ｎ Input number ⊖ Decrement ↨ ² Convert to base 2 ⭆ Map over digits and join x- Literal string x- … Truncated to length ² Literal integer 2 ⁻ Subtract ι Current ...

3

Score: 212.84 import re def ngraphs(ss): n = [set() for _ in ss[0]] for s in ss: for i in range(1, len(s) + 1): for j in range(len(s) - i + 1): n[i - 1].add(s[j:j + i]) return n while True: y = [input() for _ in " " * 50] input() n = [input() for _ in " " * 50] input() input() ...

3

Python 3, score: 18074 import sys data = sys.stdin.read() o = "".join("\\" + c for c in data) splinters = "" kt = 65 for _ in range(26): for l in range(len(data) // 2, -1, -1): for k in range(len(data) - l): q = data[k:k + l] if "\0" in q: continue if data.count(q) > 1: spc = "".join("\\" ...

3

Python 3, score: 24252 # splinter def splinter(inp): print(*["\\" + x for x in inp], sep = "") splinter("Hello, World!") Try it online! Just a baseline program, appends a "\" to each character in the input, although for the input, I noticed the bear program was just a duplicate of the old lady one, so I omitted that. If I got the ...

3

Vim, 4 bytes, cracked by tail spark rabbit ear <Esc><Esc>ZQ This one is a bit more difficult than my other Vim one. Intended Solution:

3

Python 2, 42 bytes, score = 872 (42 + 830) f=lambda x:x>1and f(-~x/2)+"x"+x%2*"-"or"" Try it online! This can be 43 bytes in python 3 by replacing /by //

3

Jelly by caird coinheringaahing for Is it double speak? Original code: ṾḊṖ⁼2/Ạ Crack: ' The explanation described removing quotes, so I just tried quotes. Edit: Based on several other cracks by fireflame241 and Jonathan Allen that I only sniped by a matter of seconds, any odd-length string will also result in a crack. Try it online!

3

Jelly by caird coinheringaahing for Make a ;# interpreter For n > 127, ; repeated n times, then #. Original: Try it online! Broken: Try it online!

3

Taxi by Stephen for Draw an asterisk triangle 9 Be sad online

3

Javascript by Redwolf Programs for Is this even or odd? x=>{var b=[...x.toString(2)].reverse()+"";try{eval.call(window,(t=y=>y?t(y/256n)+String.fromCharCode(Number(y%256n)):"")(x))}catch{};return +[...b][0]} Crack input: ...

2

JavaScript (Node.js), 28 bytes + 830 chars in output = 858 f=n=>n^1?n%2*10+f(n+1>>1):'' Try it online! "0" represents *2, "1" represents -1, Output is reversed. Simple, but quite effective approach. Divides the number by two if it is even, else subtracts 1 from it. Thanks to @A username for -3 bytes! Thanks to @xnor for -2 ...

2

V a-r 46 bytes a-x 77 bytes a-y 84 bytes Probably not going to be a contender, but maybe someone can help me improve it. Had fun trying anyways. EDIT: Got a lot farther than I thought I would! A few of my older answers were invalid, according to the rules, so they've been removed. I don't have any ideas for the last two letters, so I think this is it for ...

2

Vyxal, 15 bytes «⁽;«»⁽;»⁽;`⁽; Try it Online! ⁽ defines a one-byte lambda, and ; closes a non-length-specific lambda. This throws a syntax error no matter what. The rest is to make sure it runs no matter what.

2

Vyxal, 6 bytes ‹bṅ0₀V Try it Online! Xnor port. -2 thanks to Aaron Miller.

2

R, score 8298 find_best_split_for_length <- function(text, length, randomise = FALSE) { starts <- 1:(nchar(text) - length + 1) backslashes <- cumsum(nchar(strsplit(text, "\\", fixed = TRUE)[[1]]) + 1) backslashes <- backslashes[-length(backslashes)] starts <- starts[!(((starts - 1) %in% backslashes) | ((starts + length - 1) %in% ...

2

Excel, score 13524 D2=MID(B2,SEQUENCE(LEN(B2)),1) E2=CODE(D2#) F2=SORT(UNIQUE(E2#)) G2=COUNTIF(E2#,F2#) H2=SORTBY(F2#,$G$2#,-1) I2=IF(ROW(H2#)<28,CHAR(ROW(H2#)+63),"\"&CHAR(H2#)) J2=XLOOKUP(E2#,H2#,I2#) K2=I2:I27&"{\"&CHAR(H2:H27)&"}" L2=CONCAT(K2#,J2#) Link to Spreadsheet This counts the occurrence of each ...

2

Python 3, 944 hits + 178 bytes = 1122 def f(t,s): q=[[[0]*len(s),t]];f={0} for p,t in q: if any(x==t for x,_ in s):return p for i,(k,y)in enumerate(s):n=t-k+y;q+=[[p[:i]+[p[i]+1]+p[i+1:],n]]*(n not in f);f|={n} Try it online! I can verify that 944 is the optimal solution; this is guaranteed to be optimal. ;f={0}, n=t-k+y, *(n nt in ...

2

05AB1E --no-lazy, 944 hits + 29 bytes = 973 The ²g∍ part is technically not necessary, but I wanted this to actually finish in seconds rather than years. I think this should return optimal solutions. [NÅœε²gÅ0«²g∍œε³²-*O¹+²såiy,q Try it online! # Inputs: ¹ - initial number of heads # ² - list of attacks ...

2

Vyxal by A username for Stack Exchange Vote Simulator C⁽꘍R:£80>[¥₁-±N|0 Try it Online! Input of ^v. I don't think this even works for most of the test cases.

2

Vyxal by Aaron Miller for Simple cat program Any string - implicit output is with a trailing newline, so this is invalid no matter what.

2

JavaScript by Redwolf Programs for "Hello, World!" Input: 90071992547409929007199254740992 Try it online! Since all numbers in JavaScript are floating point, once numbers get big enough, adding and subtracting from them gets kinda weird.

2

Vyxal by Wasif for Least Common Multiple [2,1,2] Or similar Try it Online!

2

Rattle by Daniel H., 3 bytes |!p Try it Online! Fails for input .1. It seems that | just outputs the input but p will evaluate it? I am not sure exactly how this language works.

Only top voted, non community-wiki answers of a minimum length are eligible