Skip to main content

New answers tagged

1 vote

Modified Boggle Checker, with Modified Boggle-able Code

dc, score 3, 14142 bytes ...
orthoplex's user avatar
  • 399
2 votes

Is my Matrix Arrowhead?

R, 50 49 bytes -1 byte thanks to pajonk function(x,n=1:dim(x)-1)all((!n%o%n*!diag(n))-!x) Try it online! This solution is similar to the other existing 2 answers ...
1 vote

No strings attached!

Cubical Agda 2.6.5, 591 Bytes Cubical Agda library version a0b4ba3. I use the HEAD version for my convenience, but a standard release version should do. In fact a ...
Trebor's user avatar
  • 735
0 votes

Is this a valid PZN?

Common Lisp, 92 bytes Input is a list of numbers (defun p(n)(=(mod(reduce'+(mapcar(lambda(x y)(* x y))n'(1 2 3 4 5 6 7 0)))11)(car(last n))))
Paul Richter's user avatar
0 votes

Is this a valid PZN?

Jelly, 8 bytes ṖḋJ%11⁼Ṫ A monadic Link that accepts the list of eight digits and yields 1 (truthy) if a valid PZN or ...
Jonathan Allan's user avatar
0 votes

Is this a valid PZN?

TI-BASIC, 29 bytes Input A ʟA(8)=remainder(Σ(IʟA(I),I,1,7),11 This program takes an array of digits as inputs, and outputs 1 (for true) or 0 (for false). It uses a ...
Sylvester is on codidact.com's user avatar
0 votes

Is this a valid PZN?

Google Sheets, 58 bytes =SORT(MOD(A1,10)=MOD(SUM(MID(A1,ROW(1:7),1)*ROW(1:7)),11))
z..'s user avatar
  • 751
0 votes

Is this a valid PZN?

J, 15 bytes {:=11|1#.7$[*#\ Attempt This Online! ...
south's user avatar
  • 1,800
1 vote

Is this a valid PZN?

Wolfram Language (Mathematica), 31 bytes Mod[Most@#.Range@7,11]==Last@#& Try all test cases online! Unnamed function taking a list of eight digits as input and ...
Greg Martin's user avatar
  • 15.8k
0 votes

Is this a valid PZN?

Charcoal, 16 bytes ⁼﹪Σ⭆…θ⁷×ι⊕κ¹¹﹪Nχ Try it online! Takes input as a string and outputs a Charcoal boolean, i.e. - for a valid ...
Neil's user avatar
  • 172k
1 vote

Is this a valid PZN?

R, 28 24 bytes \(d)sum(d*c(1:7,-1))%%11 Attempt This Online! Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).
pajonk's user avatar
  • 16.7k
0 votes

Is this a valid PZN?

Arturo, 42 bytes $->a[0x:∑map a\[0..6]=>[&*<=1+]a\7=x%11] Try it! Explanation ...
chunes's user avatar
  • 24.7k
3 votes

Is this a valid PZN?

Python, 42 bytes lambda d:int(d[6::-1].hex())//.99%11==d[7] Attempt This Online! Expects input as a byte string. How? This abuses the hex method of bytes objects ...
Albert.Lang's user avatar
  • 2,884
3 votes

Is this a valid PZN?

05AB1E, 8 bytes ¨ƶO11%Qθ Input as a list of digits. Try it online or verify all test cases. Explanation: ...
Kevin Cruijssen's user avatar
4 votes

Is this a valid PZN?

K (ngn/k), 17 bytes It takes a digit array. ...
akamayu's user avatar
  • 541
4 votes

Is this a valid PZN?

Nekomata + -e, 8 bytes 7R¢ɔ∙11¦ Attempt This Online! ...
alephalpha's user avatar
  • 48.5k
1 vote

Is this a valid PZN?

JavaScript (Node.js), 40 bytes a=>1>a.reduce((p,v,i)=>p-~i*v,a[7]*2)%11 Try it online! From Arnauld's. 8th digit * 8 + 8th digit * 2 = 8th digit * (-1), ...
l4m2's user avatar
  • 24.5k
5 votes

Is this a valid PZN?

Python 3.8,  50  47 bytes -1 thanks to l4m2* leading to two more. Could save at least two bytes by outputting a falsey value for valid and a truthy value for invalid; potentially quite a few using a ...
Jonathan Allan's user avatar
1 vote

Is this a valid PZN?

Japt -h, 11 bytes Takes input as a digit array. ǶUxÈ*ÒYÃuB Try it
Shaggy's user avatar
  • 42.1k
1 vote

Is this a valid PZN?

C (gcc), 51 bytes s,i;f(int*l){for(i=s=0;i<7;)s+=*l++*++i;s=s%11-*l;} Try it online! function returning true if invalid, false if valid PZN code.
AZTECCO's user avatar
  • 10.8k
1 vote

Is this a valid PZN?

PowerShell Core, 43 bytes $args[0..6]|%{$s+=$_*++$i} $s%11-eq$args[7] Try it online!
Julian's user avatar
  • 3,118
2 votes

Is this a valid PZN?

APL+WIN, 23 bytes Prompts for number as a string of digits. (7↓n)=11|+/(⍳7)×7↑n←⍎¨⎕ Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 6,286
2 votes

Is this a valid PZN?

MATL, 12 11 bytes 0&)7:*s11\= Try it online! Or verify all test cases. Explanation ...
Luis Mendo's user avatar
  • 105k
3 votes

Is this a valid PZN?

Uiua SBCS, 16 bytes =◿11/+×⇌¯⇡¯7:°⊂⇌ Try it!
chunes's user avatar
  • 24.7k
1 vote

Is this a valid PZN?

Python 3, 60 bytes lambda a:sum([x*-~i for i,x in enumerate(a[:-1])])%11==a[-1] Try it online!
corvus_192's user avatar
  • 5,532
4 votes

Is this a valid PZN?

JavaScript (ES6), 40 bytes Expects an array of 8 digits and returns a Boolean value. a=>!a.reduce(p=>p%11+a[i++]*~(~i%9),i=0) Try it online! Commented ...
Arnauld's user avatar
  • 193k
-1 votes

Is this number a prime?

Dis, 19950 bytes ...
鳴神裁四点一号's user avatar
2 votes

Doubleouble Talkalk

R, 24 23 bytes -1 byte thanks to pajonk \(x)grep('.+(.+)\\1',x) Attempt This Online! Not a very special solution (regex taken here), but almost surely it's going ...
int 21h Glory to Ukraine's user avatar
0 votes

Is this number a prime?

AWK, 32 bytes {for(j=2;$0%j++;);print j~i?1:0} Try it online!
C K's user avatar
  • 91
4 votes

Is this a solvable Numberlink?

05AB1E, 71 (or 72†) bytes ˜©þàÝ®ð¢ã.Δð®r.;IgäDUàLεXQDV˜ƶIgäΔ2Fø0δ.ø}2Fø€ü3}Y*εεÅsyøÅs«à}}}˜0KÙg}P Inputs-matrix uses spaces as blank cells. Outputs a valid list ...
Kevin Cruijssen's user avatar
4 votes

Is this a solvable Numberlink?

Charcoal, 103 87 bytes WS⊞υι≔⪫υωη≔I⌈ηζFXζ№η.¿¬ⅈ«≔¹εFζ«⪪⪫⪪⭆η∨Σλ⊕﹪÷ιXζ№…ημ.ζI⊕κψLθ≔⌕ηI⊕κδJ﹪δLθ÷δLθ¤.≧×⁼LKALηε⎚»ε Try it online! Link is to verbose version of code. ...
Neil's user avatar
  • 172k
0 votes

Does the fishy road have an end?

Pip -r, 85 bytes L#Jg{xPB Y(gDo+:1210@sDp+:2101@s)I#(a:">v<^"@?y)s:aI#(b:"\/"@?y)s:(s+bBX1)-b}x~`[-|]` ...
DLosc's user avatar
  • 39.7k
5 votes

Is this a solvable Numberlink?

Jelly,  28  26 bytes ṁŻŒĠḊµŒ!ạƝ€§ṂỊ)Ȧ FoṀrƊŒpçƇ A monadic Link that accepts a list of lists containing any number of zeros and exactly two each of a non-empty* ...
Jonathan Allan's user avatar
8 votes

Is this a solvable Numberlink?

JavaScript (ES7), 122 bytes Expects a matrix of integers with 0's for empty cells. Returns 0 or 1. This is 100% brute-force, but fast enough to solve the test cases in ~2 sec. on TIO. ...
Arnauld's user avatar
  • 193k
6 votes

Is this a solvable Numberlink?

Python 3.8 (pre-release), 151 bytes ...
Jitse's user avatar
  • 7,324
0 votes

Does the fishy road have an end?

Python3, 282 bytes ...
Ajax1234's user avatar
  • 7,231

Top 50 recent answers are included