I actually want several things; the title question is just one of them, and not the most important one.
Here is some code in AWK, to show a simple definition of S.
BEGIN{ LIM = 1000; for(n=1; (n++)<LIM ; S[m]=p) for(m = n + (p=(n in S)?S[n]:n); m in S; m += p) delete S[n] }
When run, one sh...
Write a program that prints all the numbers from 1 to 100. However, for multiples of 3, instead of the number, print "Linio". For multiples of 5 print "IT". For numbers which are multiples of both 3 and 5, print "Linianos".
challenge
But here's the catch: you can use only one if. No multiple br...
Note: This is the radiation-hardening version of my previous challenge Pristine Bit Checking. This should be much more difficult than that one.
Write a program/function that takes two integers in the range \$0\$ to \$255\$ inclusive, and returns whether the binary forms of the numbers are exactl...
@ASCII-only is there any actual challenge to golfing that, or is it just "pass ruby code through the __script__ function" to get the _ code?
It also just appears to be translating the codepoint of each character to base 6 with three digits and then adding one to each digit and printing that many underscores, separated by spaces
An alternative translation(without special effects) for an existing language is trivial. As far as I can tell, the only possible way for a human to program in _ is to program in the Ruby alternative. Thus it is not worth putting on TIO.
This puzzle is based on this Math.SE post.
Assume I have some number of black shirts and some number of white shirts, both at least 1. Both colors of shirt have a non-zero durability. All shirts of a given color start with the same durability.
Every day, I pick out a clean shirt to wear, and it...
Create an interpreter for *
code-golf interpreter
The task is simple. Write an interpreter for the language *.
A * program can consist of one of three commands:
* Prints "Hello World"
(Space)*(Space) (Where (Space) represents a space character) Outputs a random number between 0 and 2,147,483...
You could index into a list containing the list of consonants and the list of vowels, or possibly even do something with ƭ (although that would probably just be silly)
In Brachylog you can just slap on ∋ᵐcẉ⊥, but Jelly like the vast majority of languages does not have backtracking, so you'll need to do something requiring a bit more thought
`ṗ5Œœ€` returns a set of pairs odd/even (works fine). I need to check that even part contains only `Øỵ` chars, and the odd part only `ØỴ` chars, but neither `Ƈ` nor `Ðḟ` (associated with `e€` things ...) seem to work. Any ideas? I'm so close, it bothers me ._. Then this will interleave the things that were not filtered out: `żƝ€Y` (works fine)
This is a more complicated version of this puzzle. The premise is the same but a few rules differ in a few key places, making for a more complex problem.
Assume I have some number of black shirts and some number of white shirts, both at least 1. Both colors of shirt have a non-zero durability. A...
We've all done it, well, maybe not, but making your own alien language and numbering system is a staple of especially fantasy writing, but is mostly just a fun activity.
The task is simple, take two inputs:
An ordered list input of 10 [ten] unique 'numerals' (any printable
ASCII character) and...
Let's say I have this pseudo code:
function find_between_string(haystack, start_delimiter, end_delimiter) { /**/ }
output = find_between_string(input, "foo", "bar");
Some example input and output:
fooquxbar -> qux
abc -> [nothing]
barfooquxbarfoo -> qux
Now, if the input string is its own ...
This challenge is based on a video in which Andrew Huang discusses unusual time signatures...
https://www.youtube.com/watch?v=JQk-1IXRfew
In it, he advises that you can understand time signatures by dividing them into 3's and 2's. So you count to a small number a few times, instead of counting ...
I posted this challenge about a week ago, and it has since become fairly popular with nearly 40 answers. In the chatroom, a user asked whether teaming was allowed. I said it was, if someone could figure out how it could even work.
Two teaming bots were posted shortly after, one of which easily t...
can't exactly tell what that is, but it sure looks wrong as hell...
Anonymous
First part is making a map out of an array using obj.id as the key. That's fine. The second part is then taking the values of that map and making a new map that is identical to the old map, but also adding a property to the objects
Anonymous
The correct way would have been objMap = objs.reduce((acc, obj) => { obj.someProp = 'foo'; acc[obj.id] = obj; return acc; }) and not having the second part
Anonymous
The developer responsible for the code was slapped with a trout
@Mego Is there any particular reason trouts are especially suited for slapping people?
CMC: Slap Jimmys with a trouts; given a 2D string consisting only of spaces and Jimmys separated by one or more spaces, e.g. /o\ /o\ place trouts <>< such that one fish head is immediately above each Jimmy's head. The input will always be such that no Jimmy will end up covered by a trout.
4
E.g.
/o\ /o\
/o\
/o\
becomes
<>< <><
/o\ /o\<><
<></o\
/o\
You may (need to) add a line before the first line. Trailing whitespace is OK.
Here's a challenge I'd like post because I'm curious to see what people will come up with. It's a bit of an anti-code-golf question because the code should look normal.
Is it clear what the constraints? Did I miss anything?
Introduction
Write a piece of unsuspicious code that does the follow...
TIL: Delphi has 5 different OOM messages: 'Out of Memory'; 'Out of Memory!'; 'OUT OF MEMORY'; 'projectName.dproj is out of memory'; and 'Could not create output file <name>: out of memory.' They seem to be very much interchangeable (apart from maybe the last one).
@mınxomaτ Judging by the name and the choice of words, I'd hazard a guess and say this person is Brazilian
"Performático" is a valid word in Portuguese, they probably transliterated it.
@J.Sallé I suppose the first three are various degrees of being out of memory. Like, ordinary memory is all out; absolutely no memory left, even in nooks and crannies; darn it, we've started to borrow memory from the neighbours.
@Adám borrowing memory from the neighbours is definitely standard Delphi practice. I can't compile a delphi project and work on my Go side project at the same time
Also sometimes it just crashes the IDE without any messages and when I try to open it again I get some 20+ "Access violation at <memory location> in <dll name>" warnings.
@J.Sallé Have you tried hooking up Delphi to your Amazon account? I bet you'll see OUT OF MEMORY!! when it has bought all the memory it could get its hands on.
Tangentially related anecdote: My father was once called out to one of his customers because the software my father had written for them suddenly stopped working, though no change had been made to it. Turns out a rogue technician had serviced the computer and saw his opportunity to steal the 80387 math co-processor my father's code was relying on.
Calculate mobile data coverage
Background
You've been hired by the HQ of Vodafizon - a relatively new mobile network provider interested in spreading to the global market. In particular, your job description involves working as a marketing rep to produce ads for each country, where you give a f...
Based on comments from an earlier (now closed) version, this version of wants only golfed answers implementing S as given below (except set LIM to something at least as large as 10^8). Shortest code (in bytes) of source in any language will be used in ranking. I am new to posting here, so please...
Create a function that takes in a generator function as its only parameter, and returns an object that can be used as both as a generator and a generator function for said generator.
For example:
let sg = SelfGenerator(function*(n){
yield n;
yield n + 1;
yield n + 2;
});
sg.start(...