New answers tagged

0

Make a "proof" generator How to prove that 1 = 2: 1 = 2 2 = 4 -1 = 1 1 = 1 You can just multiply both sides by 0, but that's cheating. This is just bending the rules a little bit. Your challenge: Write a program/function that, when given two integers, outputs a "proof" that the two are equal. Rules Your program's output must start with ...


0

Make a polyglot generator code-challenge polyglot A polyglot is a program that runs in several languages. Your challenge is to: Choose several languages Create a program or function that takes several integers (one for each language you chose) and returns a program that: Runs in all of those languages When run in language A, outputs the first number; When ...


0

Generate simultaneous equations code-golf random math You've been tasked to write maths exam questions, but you're getting quite bored of coming up with simultaneous equations with integer solutions, so you decide to write a program to generate them. Because this is a school test, the questions mustn't be too easy, but they also mustn't be trivial. The ...


1

An approximation for factorials of reals One approximation for factorial function of reals is the following function: \$ F_0(x) = \lfloor x \rfloor ! { \lceil x \rceil } ^ { x - \lfloor x \rfloor } \$ The function is less inaccurate for higher values of \$ x \$, meaning that you can get better approximations using the following recursive definition: \$ F_{n+...


1

Memory KoTH Memory is a game where a bunch of pairs of identical cards are laid upside down, and you try to find pairs while only looking at two at a time. In this KoTH, the way it will work is: The game will be played on a 64x64 grid, and the "cards" will be integers 0-2047. Each bot takes its turn in order. It has access to the results of ...


-1

Generate a Printing Program In Some Language Task Given some rules: 1: Hello 2: World 4: Code 7: Golf 9: Whatever Your program should output a program (the output), which should be a valid program in some language. When the output is run, it should Ask for some input (i), Then output the string in the ith index in rules. (If there are none, don't output ...


0

Implement the ordering monoid Objective Mimic Haskell's (<>) :: Ordering -> Ordering -> Ordering. What's the fuss? This particular monoid is rather useful for comparing sequential containers lexicographically. Format Though Ordering is defined as a three-element enumeration, in this challenge, the format of the 2 inputs and the output is ...


-2

Am I a Prime Word? code-golf internet primes decision-problem Challenge A Prime Word is an English word which is a prime when converting the word from Base36 to decimal. For example, breakfast is a Prime Word because breakfast converted from Base36 to decimal is \$33179155333229\$, which is prime. An English word, in this case, is considered to be a word in ...


0

You want to have some drinks. Each bottle of drink has a drink itself and \$n\$ other parts (the bottle, etc.) \$P_1, P_2, ..., P_n\$. Thus when buying a bottle of drink, you also get one of each of \$P_1, P_2, ..., P_n\$. You can buy a bottle of drink using 1 dollar, \$a_1 P_1\$s, \$a_2 P_2\$s, ..., or \$a_n P_n\$s. Given the amount of dollars \$b\$ and ...


1

Create word lightning ascii-art string tree Inspired by a Codingame challenge I tried (and failed at) recently. Given a binary tree of words, say: HELLO / \ WORLD EATING / / \ ARCH IDAHO GUARD / DOOZY / ZEPPELIN ...


5

The close reason is simple. You need details and clarity. There is no reason beyond that to close your question. Here's a few things you can improve, to be specific: You require a clear description of what an uncomputable number is, and maybe link to it. A single line description is not enough, and having more examples would help with understanding the ...


1

Convert version string to pack_format code-golf When making a Minecraft data/resource pack, you need to include a pack.mcmeta file, which specifies information about it. pack.mcmeta contains a description, but it also contains a pack_format number, which tells Minecraft which versions this pack is for. Your task is to take a version string, and output what ...


2

Modify to Increment: Javascript Edition (WIP) answer-chaining javascript Your task is to insert bytes/characters into the previous answer such that it outputs the next number in sequence, spelled out in English, as its return value. The first answer must output one. Coding restrictions Your answer's code must be atomically irreducible, meaning that if it is ...


3

Merge them all into voting up-votes and down-votes shouldn't really exist in the first place tbh. They are both fully covered by voting, and a lot of the existing posts with those tags are also tagged with either votes/voting As discussed in chat, votes could also cover vote-to-close/reopening/vote-to-delete (as well as election votes). This is far too broad ...


0

Functions may return multiple values, even if the question only asks for one. As long as one of them is the requested output, the function is considered valid.


2

Optimal addition subtraction chain Posted


0

[Draft] Write out the 2x2 Hamiltonian Circuit Unlike the 3x3 Rubik's Cube, which famously has over 43 quintillion possible positions, the 2x2 Pocket Cube "only" has about 3.7 million positions, making a Hamiltonian circuit (a set of moves that visits every position exactly once) perfectly feasible to output or store in its entirety. The full ...


0

Posted here


5

posted


1

1D monochrome Link-a-Pix solvability code-golf array-manipulation puzzle-solver decision-problem Background Link-a-Pix is a puzzle on a rectangular grid, where the objective is to reveal the hidden pixel art by the following rules: Connect two cells with number N with a line spanning N cells. The number 1 is considered connected to itself (which makes it an ...


2

Distance between vowels Objective Given two vowels represented in single IPA characters, calculate the distance between them. Vowels Vowels are characterized by three factors: Height, backness, and roundedness. Here, all vowels have the three characteristics as integers. Unrounded vowels (z = 0) x=0 x=1 x=2 x=3 x=4 y=6 i(U+0069) ...


1

Complete the Square (UNFINISHED) code-golf math polynomials Completing the square is (part of) a method for solving quadratic equations, which involves turning something like this: $$ax^2+bx+c=0$$ Into something like this: $$a(x-h)^2+k=0$$ I'll show how I was taught to do this. Take the quadratic \$2x^2-8x+16\$. First, divide out \$a\$: $$2(x^2-4x+8)$$ Now, ...


0

How Many Students are in our clubs? You are a principal in CG High School, and you want your school fliers to include data on how many students are part of any particular set of clubs. You command your secretary to get this data, but they goofed up. Instead of giving you the data on how many students attend (for example) tech club, math club, and spanish ...


1

200 rep for a 2D Language answer to Rotation-safe quine - Claimed by Martin Ender What it says on the tin. You can use any language which uses two-dimensional syntax (Fish, Befunge, Klein, Labyrinth, etc) to create it. It must be a proper, valid quine and the language must have been made before this bounty offer had been posted. The bounty value may increase ...


1

A general-purpose macrogenerator code-golf interpreter Briefly: Implement Christopher Strachey's “General-purpose macrogenerator”. Background In section 1.2 (Historical References) of the manual for GNU M4, an early macro processor is mentioned: An important precursor of m4 was GPM; see C. Strachey, “A general purpose macrogenerator”, Computer Journal 8, 3 ...


2

Just Enough Ones


0

Is this code golf too simple? Do I need to add more? Has something similar been done before? The idea of this golf is to convert a string of 3 or more characters to a grammatically correct list. Examples: 12345 becomes 1, 2, 3, 4, and 5. ab5 becomes a, b, and 5. A comma and space is to be inserted between each character, and the last character should be ...


0

Encode a Lenguage The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, then turn that into a giant integer. Your challenge is to write a function or program that encodes your language into a Len language. However,...


0

Surprisingly, I don't think there has been a question about Whyte notation before. I suspect the ASCII challenge is a bit too easy, but not sure how many people are interested in a graphical challenge. Thoughts? Comments? Whyte notation Write a program which turns a string containing a valid (subset of) Whyte notation into an ASCII/graphical representation. ...


0

Determine tournament winners code-golf Given a table of names and per round scores, arrange the names in descending order of their Neustadtl Sonneborn–Berger score. Challenge A player's Sonneborn-Berger score(which we will from now on refer to as "tiebreak score"), is the sum of the points they received in each round (\$x_{i}\$), multiplied by the ...


1

When will DST start / end (WIP) code-golfdate Write a program (full or function), takes no input from user, tell user when next Daylight Saving Time shift will happen in the following year for users timezone (as configured on users' system / environment). Output should be the time when DST starts / ends in second precision, or output some other non-ambiguous ...


1

Count my sheep code-golf matrix Given a boolean matrix representing my grass field, sheep length \$n\$ and wool thickness \$k\$, you will have to count my sheep. A sheep is a single independent unbroken line of sheep length \$n\$ and thickness \$k\$. #|##|# | # #| | #|# are all valid sheep for \$n=2,k=1.\$ ##|###|## | ## ##|###| ## | ## ##| | ##|## ...


2

Minecraft piston pushing


4

Reveal by Halves (in need of a better name) array-manipulation code-golf subsequence Inspired by this: http://nolandc.com/smalljs/mouse_reveal/ (source). A valid answer: Takes a number \$w\$ and (assumed non-negative) integer \$x\$. Outputs an integer list with a length of \$2^w\$, initially filled with zeroes. For each number \$n\$ from \$0\$ to \$w-1\$ (...


2

Are You My Mother? (very WIP) king-of-the-hill (coincidentally, thought up around mother's day) Oh no! All the newly-hatched ducklings have been mixed together, and they all look the same! The ducklings want to reunite with their own mother. But the mothers are also selfish and want as many ducklings as possible to go home with them. Since all the ducks ...


1

Square chunk my matrix (Title suggestions welcome) I have no context for this. Your challenge is to write a function/program that takes a matrix m and a number n as input and: Splits the matrix into nxn chunks Replaces each chunk with the most common value in that chunk (In case of a tie, any of the tied values is fine). Outputs the resulting matrix. Example:...


4

Floor of complex number code-golf math complex-numbers apl open-ended-function Background Complex floor is a domain extension of the mathematical floor function for complex numbers. This is used in some APL languages to implement floor ⌊, ceiling ⌈, residue |, GCD ∨, and LCM ∧ on complex numbers. For the rest of this challenge, an integer refers to a ...


0

As long as a bot follow/fulfill the rule/tasks, it’s valid I agree that changing rule late isn’t the best solution for edgy bot like rude random, instead, all restriction should be clear at the beginning. Option: Let randomness come in I don’t fully agree with banning extreme bots, just like normal coding challenges, there is always edge case(game) that you ...


0

xnor's hoard I have a bunch of old Sandbox posts that I don't feel like developing, some of which have a number of upvotes. Feel free to edit and post them. I just ask that you ping me before you post in case I have suggestions.


2

CGCC sings a song together


0

Radio station hopping You are listening to a car radio. You are pressing seek up/down, moving you to the next frequency some radio station broadcasts on, to avoid all this pointless music and listen to all the ads, or vice versa. But there is a tendency of these broadcasts to have your radio jump to another frequency, where signal of that radio station is ...


0

Implement OADD_MONTHS code-golfdate Introduction The concept of a function to add months to a date, without overflowing if we reach the end of the month, is implemented in many languages/packages. In Teradata SQL it's ADD_MONTHS, here are some examples: ADD_MONTHS('2021-01-31', 1) => 2021-02-28 ADD_MONTHS('2021-01-30', 1) => 2021-02-28 ADD_MONTHS('...


1

Sum multiplication carries We have already counted how many carries are there in a sum. But what's their sum in a multiplication? A carry is a digit that is transferred from one column of digits to another column of more significant digits. When multiplying 15 and 3, a carry of 1 happens: 1 1 15 15 15 × 3 -&...


4

Challenge Statement The goal of this challenge is to build the 5 state Infinite Time Turing machine that takes the longest to halt. The rest of this challenge is some definitions and an example to help you. Turing Machines For clarity we will define the Turing machines as used for this problem. This is going to be rather formal. If you are familiar with ...


0

Solve any NPC problem. Shortest code win. Sandbox Notes Will every submission tend to single NPC problem? How many builtins are known to solve this in Mathematica? Do 0-byte solution exist?


0

Base Guard (Rewritten) base-conversioncode-golfnumber Base: part 1 This is part 2, Strongly suggest you go try out the first one if you haven't tried it. Story As one of the solvers, You've managed to get to the door of the base heaven. In front of the door stands the base guard @Lyxal, he was angry that you all just left the encoded text on the ground, he ...


0

Regex, ASCII-literal Objective Execute the given regex for the given text. The regex is in a special scheme I made. Motivation For most regexes the usual languages support, they assign some printable ASCII characters for special instructions. For POSIX as an example, * is the Kleene star, . matches an arbitrary character, and ( and ) groups a subexpression. ...


3

Turn-based RPS Poker king-of-the-hill card-games javascript This is a two-player card game which resembles a vastly simplified game of Texas Hold'em, combined with RPS (rock-paper-scissors) and the most basic mechanic of commercial turn-based card games. The deck A single full deck consists of 30 unique cards, where each card has one symbol out of RPS and ...


0

Given a subset of {+,*,<,=,E,A,(constant),(variable)}. For most of the subsets, use the symbols to express Riemann hypothesis. Output format flexible. Most subset, and on tie, smallest (code length+sum symbols used) in each language wins. (So there'll also be a winner in Text) You can also choose to focus on sum symbols used, and claim that you answered ...


Top 50 recent answers are included