Gomoku
Tags: king-of-the-hill,board-game
Related: Connect-n time!
Gomoku or Five in a row is a board game played by two players on a \$15 \times 15\$ grid with black and white stones. Whoever is able to place \$5\$ stones in a row (horizontal, vertical or diagonal) wins the game.
Rules
In ...
@Fatalize Sometimes Dyalog APL actually allows something like that. If you specify a transformation as a tacit function, you may be able to run it in reverse using the "power" higher-order function.
E.g. if f←4-⊢×2×⊢ which means f(x)=4–x∙2∙x and then require that to be –14 with (f⍣¯1)¯14, i.e. 4–x∙2∙x=–14 then APL will respond with 3 because 4–3∙2∙3=–14.
So too, if you require that when dropping the last element from "ab" concatenated to the reverse of x, i.e. requirement←¯1↓'ab',⌽ you get "abzy", then (requirement⍣¯1)'abzy' will yield " yz" because reversing that gives "zy " and prepending gives "abzy " and dropping gives "abzy".
@Fatalize Both that, and it also has a table of inverses and how inverses combine.
@Fatalize But it is still useful, e.g. to apply several transformations under the condition that they ALL succeed. E.g. I can strip outer brackets with ('['∘,,∘']')⍣¯1 and APL will throw a DOMAIN ERROR if any of the brackets are missing.
Unrelated anecdote: I often travel with the London Tube (metro system) and it always bothers be when they announce in the speakers: Please use all available doors! or Please use the full length of the platform!
@Fatalize Because humans don't have a hive mind. No individual can follow such instructions. They need to say There's more room at the north end of the platform! or The back three doors are best if you want a chance to board!.
@MuhammadSalman Anyway, I'm very well. How are you? I have not seen you here for a while.
@Fatalize Understandable, yes, but utterly useless. I can't see more than a small section of platform or more than two doors at a time (obviously they only make these announcements when the Tube is crowded), but they do not provide me any information which I can use to make choices which help relieve congestion.
@MuhammadSalman Ready to take up APL studies again?
Not to be confused with Least Common Multiple.
Given a list of positive integers with more than one element, return the most common product of two elements in the array.
For example, the MCM of the list [2,3,4,5,6] is 12, as a table of products is:
2 3 4 5 6
---------------
2 | # 6...
We've got quite a few national flag challenges already:
AU
CH
FI
FR
GB
GB
IS
KR
NP
US...
Here's another, somewhat more advanced one:
Return or print the decorative pattern from Belarus's national flag as a matrix of two distinct values for red and white.
If your language doesn't support matri...
I remember waiting for a question to be posted, and it was actually posted, but I only realized when it got posted in here by NMP, and there was already one answer
I challenge you to write the shortest code possible to produce a quine that is a palindrome. The quirk here is that you are not allowed to use any comment functionality.
Rules:
Shortest code wins
Use rules for quines from this page: Write a Polyquine
No comments are allowed.
For instance, th...
Evaluate Words Based on "Rules" (Skeptics.SE Crossover)
I came across this picture, which I initially questioned and thought about posting to Skeptics. Then I thought they'll only tell me if this one case is true, but wouldn't it be great to know how true any "rule" really is? Today you're going...
Naismith's rule helps to work out the length of time needed for a walk or hike, given the distance and ascent.
Given a non-empty list of the altitude at points evenly spaced along a path and the total distance of that path in metres, you should calculate the time needed according to naismith's r...
We define \$V(x)\$ as the list of distinct powers of \$2\$ that sum to \$x\$. For instance, \$V(35)=[32,2,1]\$.
By convention, powers are sorted here from highest to lowest. But it does not affect the logic of the challenge, nor the expected solutions.
Task
Given a semiprime \$N\$, replace eac...
Balancing list of strings
Lets define a balanced list of string as a list of strings where the length of each other are equal.
Example:
- Hello
- House
Above strings are balanced since both lengths = 5
- Codegolf
- Puzzles
Above strings are not balanced since the first one length = 8 and ...
Pikachu, 1563 bytes
pi pi pika pi pi pika pi pi pika pi pikachu
pi pika
pi pika pikachu
pi pika pika pikachu
pi pika pi pi pika pi pi pika pi pikachu
pi pikachu pi pikachu
pikachu pikachu pi pikachu
pika pi
pika pi
pi pikachu pi pikachu
pi pi pikachu
pi pika pi pikachu
pikachu pikachu pi pikachu...
can we all just agree that if the output of passing --help to the program you're writing is more than 25 lines it needs to either just open your program's man page or at least pipe it into a pager program
running foo --help and having to scroll in your terminal is the most annoying thing
@Pavel you forgot to #include <unistd.h>, the compiler assumes it's an int execv(char *) and the calling convention for that on x86_64 happens to be compatible with int execv(const char *path, char *const argv[])
@flawr Not sure. I’ve been in Dublin since Friday. But the forecast was really high temperatures, and it wouldn’t surprise me that some regions of the South had reached that. I just landed back, and I haven’t stepped on the outside yet :-)
Is modifying /usr/share/misc/magic by hand a bad idea
I like how the comments for the microsoft executables section are super sarcastic You can just feel the "why would anyone design a binary format like this"
Hmm, binfmt_misc doesn't seem to have a way to distinguish regular PE files from .NET executables
Note: this is my first time posting, so I need help fleshing out the details. I'm aware there are plenty of Roman Numeral problems, but this is somewhat different.
When in Rome, count as Romans do!
This problem is inspired by this website, which published the following diagram:
This diagram ...
Hi, all. I recall seeing somewhere a tetris game written in obfuscated Perl 5, where the code was shaped into tetris blocks. I can't seem to find it with a Web search or a perlmonks site search. Can anyone point me to it, please?