Quantcast
Channel: Landmine Number V - Code Golf Stack Exchange
Browsing all 14 articles
Browse latest View live

Answer by Nahuel Fouilleul for Landmine Number V

Perl 5, 83 byteseval"$F[0]=~/$1.*$2(?{\$s+=\$&=~y,$1-$2,,-\$&=~y,$1$2,,})^/"while/ (.)(.)/g;$_=$s|0Try it online!

View Article


Answer by Leo for Landmine Number V

Husk, 7 bytesΣפ=…Ṗ3Try it online!Makes good use of the … range operator, which given a list of characters fills in all the missing characters to leave no gaps in the alphabet. For example:…"CF" =>...

View Article


Answer by Saladin for Landmine Number V

m68k assembly, 72 bytes20 6f 00 04 48 e7 30 20 70 00 22 6f 00 14 12 18 67 30 14 18 4a 11 67 f2 b2 1966 f8 76 00 24 49 4a 12 67 08 b4 1a 66 f8 52 83 60 f4 24 49 b2 12 64 0a b4 1256 cb 00 06 65 02 d0 43...

View Article

Answer by Jonah for Landmine Number V

J, 46 bytes+/@(e.~[:>@,((#~]<{:)\{@;"1(#~]>{.)\.))&(3&u:)Try it online!Convert to ascii codesFor each element in the main input, find all elements to the left that are less, and all to...

View Article

Answer by Neil for Landmine Number V

Retina, 59 bytes~["Lw`"|'|L$`¶(.)(.)$1.+$2/.+/_~L$`(.).+(.)[A-$1$2-Z]¶.Try it online! Takes the landscape on the first line and the letter pairs on subsequent lines but link is to test suite that...

View Article


Answer by lyxal for Landmine Number V

Vyxal, 84 bitsv2, 10.5 bytes3ḋ'1⋎⁰cnÞ⇧*;LTry it Online!Ports user1609012's python answer, so make sure you go upvote that. It's a much simpler answer than what I would have come up...

View Article

Answer by 138 Aspen for Landmine Number V

Scala, 153 bytesGolfed version. Try it online!(l,f)=>{var c=0;for(i<-0 to l.length-1;j<-i+1 to l.length-1;k<-j+1 to...

View Article

Answer by user1609012 for Landmine Number V

Python 3, 88 85 byteslambda l,f:sum(x+z in(x<y<z)*f for x,y,z in combinations(l,3))from itertools import*Try it online!-3 bytes thanks to @tshExplanationJust uses itertools.combinations to...

View Article


Answer by Neil for Landmine Number V

Charcoal, 38 32 bytesSθWS⊞υιIΣ⭆θ⭆…θκ⭆…θμ∧№υ⁺νι∧‹νλ‹λιTry it online! Link is to verbose version of code. Takes the landscape and a list of newline-terminated pairs as input. Explanation: Saved 6 bytes...

View Article


Answer by Kevin Cruijssen for Landmine Number V

05AB1E, 22 14 bytes3.ÆεÐêQ×ιнJ}åO-8 bytes by porting user1609012's Python answer, so make sure to upvote that answer as well!Inputs in the order landscape, flags, where flags is a list of 2-char...

View Article

Answer by Arnauld for Landmine Number V

JavaScript (ES6), 69 bytesExpects (set)(string).s=>g=([c,...b],o='',[p,,q]=o)=>q?s.has(q+p):c?g(b,o)+(c>o)*g(b,c+o):0Try it online!Commenteds => // s = set of letter flagsg = ( // g is a...

View Article

Image may be NSFW.
Clik here to view.

Answer by JvdV for Landmine Number V

Assuming OP made some mistakes in their samples (see comment section):Excel (ms365), 168 bytesFormula in...

View Article

Answer by 138 Aspen for Landmine Number V

Wolfram Language(Mathematica), 97 bytesGolfed version. Try it...

View Article


Landmine Number V

BackgroundYou have again x4 been given the task of calculating the number of landmines in a field. But this time, the field is not a number field... it's a field of letters. Our landmine letter...

View Article
Browsing all 14 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>