Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Chess is a strategic game played with two players on a checkered grid. This tag is for challenges related to chess or any variation on chess.
2
votes
The Knight's Dialer
05AB1E, 24 22 bytes
F•žNjεEÿ¶^²è+%•5¡sèS}g
Amount of hops as first input, and the starting digit as second input.
Try it online or verify all test cases (except for the one with 20 hops, which times …
2
votes
The Knight's Dialer
Java 8, 137 129 91 89 bytes
int f(int n,int k){return--n<0?1:k%2>0?k==5?0:f(n,2)+f(n,4):2*f(n,k>0?1:4)+k/4%2*f(n,0);}
Port of @Arnauld's JavaScript answer, provided by @OlivierGrégoire.
-2 byte than …
4
votes
Knight to fork!
05AB1E, 16 bytes
Ç®X‚xâDí«δ+çJ˜.M
Inspired by @mousetail's comment!
Try it online or verify all test cases.
Explanation:
Ç # Convert the (implicit) input-triplet of strings to pairs of their …
1
vote
Parlett's movement notation
Java 10, 631 608 606 597 578 504 489 475 470 bytes
s->{int i=0,k,d,n,x,y,l,e[],f[];var m=new boolean[81];for(var p:s.split(",")){e=f=new int[81];e[40]=k=1;for(var P:p.split("\\.")){f=e.clone();k++;fo …
1
vote
8-bit Chess Pixel Counting
05AB1E, 41 bytes
Ç`+É•wH˜OÝ•44в*s11%©è•2ĀpakΩÕðβ•₂в2ä+sè®è
Try it online or verify all test cases.
Explanation:
Ç # Convert the (implicit) input to a list of codepoint integ …
3
votes
Is this draw by repetition?
Java 10, 336 330 287 285 282 276 bytes
m->{var V=new java.util.HashMap();int i=64,A[]=new int[i];var t="";for(;i-->0;)t+=A[i]=(i%56<8?i%8*35%41%10%8+2:9>>i/16&1)*(i/32*2-1);V.put(t,1);for(var a:m){fo …
1
vote
Count rook moves 1D
Java 11, 35 32 bytes
s->(s+s).strip().chars().sum()/9
Port of @Joel's Python 3 answer.
-3 bytes thanks to @Joel as well.
Uses NULL-bytes (\0) for Rooks and tabs (\t) for spaces.
Try it online.
I tri …
7
votes
Generate the Chess Numbers™
05AB1E, 11 10 bytes
8Lã18δβƵz+
-1 byte thanks to @ovs.
Try it online.
A port of @JosephWalker's Python 3 answer is 11 bytes: 7ÝT+18*8LâO - Try it online.
A port of @Arnauld's JavaScript first answer …
3
votes
Generate the Chess Numbers™
MathGolf, 12 bytes
8r♂+G*mÉ8╒+─
Try it online.
Explanation:
8r # Push a list in the range [0,8)
♂+ # Add 10 to each to make the range [10,18)
G* # Multiply each by 18
…
5
votes
Generate All 8 Knight's Moves
MathGolf, 9 bytes
2╤ç■gɱ~¡
Try it online.
Explanation:
2╤ # Push a list in the range [-2,2]: [-2,-1,0,1,2]
ç # Remove the 0 with a falsey filter
■ # Cartesian product with …
1
vote
Convert Descriptive Notation to Algebraic Notation
05AB1E, 29 bytes
Çнθ<…BNR¹Åsk+.•7œΔ&‘•èI9*¹θα«
Port of @tsh' JavaScript answer
Inputs in the order notation,perspective, where the perspective is 1/0 for black/white respectively.
Try it online or ve …
2
votes
Seeing the queen's lasers
05AB1E, 69 68 bytes
θDI¹->©н‚ß®W.ý`D¹н‚ß¹н¹ß)vyN4%N8«.Λ}1A0.ΛS¶¡¶δ.ø¬g¶иšĆ2Fø€ü3}εε˜¶KÙg
Inputs as two loose pairs, in the order [queen x,queen y], [board width,board height].
Try it online or verify …
2
votes
Print every Fool's Mate
05AB1E, 37 36 bytes
56āÌ'fìâ„g4δšDí«ε`"1.ÿ eÿ 2.ÿ Qh4#",
Try it online.
If outputting as a list of lines is allowed, the trailing ", can be removed for -2 bytes: try it online.
Explanation:
56 …
3
votes
Print every Fool's Mate
Whitespace, 380 378 bytes
[S S S T S S S N
_Push_n=8][N
S S N
_Create_Label_LOOP][S S S T N
_Push_1][T S S T _Subtract:_n=n-1][S N
S _Duplicate_n][N
T T S N
_If_negative_Jump_to_Label_EXIT][ …
8
votes
Is it a plausible chess move?
05AB1E, 12 8 bytes
αDËsP3‹~
-4 bytes porting AndrovT's Vyxal answer.
Input as two pairs of codepoints.
Try it online or verify all test cases or verify every single pair of chessboard positions.
Orig …