New answers tagged

0

Same String Regardless of Repetition Challenge Write a full program that prints a string that has a length of at least 1. When the source code is repeated any amount of times, that string should still be outputted. For example, if my source code is ABC and it prints Hello, World!, then ABCABC will still print Hello, World! and ABCABCABC will also print Hello,...


0

Largest turing incomplete subset of ASCII We have challenges about trying to find a short, turing complete number of characters in a language. In this challenge, you'll do the opposite, trying to find the largest subset of characters which is not turing complete. Rules: Like code-golf, competition is purely within a language, not between different ones ...


0

Build the stove controller (physically) atomic-code-golf logic-gates Challenge Build the Wheat Wizard's stove using 2-input NAND gates. The solution with the fewest NAND gates wins. Externally, it works in the following way: (the first line is added from the original spec for physical output) It has 10 levels, from 0 to 9. The display has 9 lights, and if ...


0

Okie, because uh, replacement for my old name edison1119 because security sucks. My pfp is niko because niko is god.( from game Oneshot) My pfp was my facebook pfp since I associated using it. After I joined CGCC, I decided to change my pfp. chat pfp comes from cat girl/boy week. meow


0

Integer points on Hyperspheres Given two non-negative integers \$r\$ and \$d\$, write a program that will output the number of integer points that lie on all hyperspheres of dimension \$d\$ or lower with radius \$r\$ or lower. For example, given \$r = 5, d = 2\$, the program would do something like this: The hypersphere of dimension 2 is a circle. The radius ...


2

Play RPS with 3 bits of memory king-of-the-hillrestricted-memory This is a rough draft for now, the specifics, presentation and title will probably be adjusted In this game you will be building bots to play rock paper scissors against each other. Of course rock paper scissors is not a very interesting game, just pick one of the three randomly. Can't get ...


3

Is This Scrabble Board Valid?


4

Alphabet Reconstruction


0

Flobnar Flobnar is the lesser known sibling of the Befunge family of languages, described by the creator as "[getting] Befunge-93 drunk to see what would happen". It is a semi-functional 2D language that is many respects similar, but not quite the same as Befunge. It is more akin to my own language Cascade (previously featured on LYAL), in that ...


1

Wave square Task Given an integer \$n\$ with the constraints \$0 < n \leq 9\$, output the corresponding square, that for each row shifts the sequence from \$1\to n\$ by one, overflowing when needed. I/O Input is an integer \$n\$, \$ 0 < n \leq 9\$. Output can be as a returned String, matrix, array or to STDOUT. You can write a full program or a ...


1

Can all the pearls be collected? code-golfdecision-problemgamegrid Quell is a single-player grid-based puzzle game. Pearls are scattered across a 2D map and the aim is to collect them all by rolling a drop of water over them. For this challenge we will only consider basic maps containing the drop, pearls, and walls (the full game includes a variety of ...


0

Best Rotation code-challenge If we rotate a raster image by some angle that is not a multiple of \$90°\$, we will have to use some kind of interpolation. Depending on what kind of interpolation method we use, we get a better or a worse quality. This is especially apparent if we repeat the rotation multiple times. In the following image we se the original on ...


0

Pattern in Prime Given a positive integer less than 100 with no preceding zeros we have to find all 12 digit primes that contains the maximum number of time the given pattern. Note: Pattern's occurance can overlap. For example 11 occur 6 times in 1111111 Example: pattern = 1 , count = 13 the maximum occurance is in 111111110111, eleven, and those 12 digit ...


2



2

Unicode Calendar Generator Rules Your program will receive a valid date in the format relevant to your language (date object or three int for year, month, day or whatever) and should returns a fancy unicode calendar as such (note that the title is right/left aligned): Given Y-M-D as 2021-10-13 Then ╔════════════════════╗ ║ October ░░░░░ 2021 ║ ╟──┬──┬──┬──┬──...


3

Pythagorean triples given the hypotenuse.


0

Newton Polynomial A newton polynomial is a interpolation polynomial where the coefficients are found using the Newton's divided differences method. The relevant Wiki is here. Your task has two parts: Given a set of inputs and outputs to find and display the polynomial that describes the series. The input can be as two lists or a dictionary like structure. e....


0

Implement Unix Timestamp to Daytime Given an unsigned integer that represents a timestamp sice 1970/01/01 00:00:00, output one of these: An array that stores year, month, date, hour, minute, second. A string in format YYYYMMDDHHmmss. Or whatever similar, as long as it complies with standard i/o rules. Rules Implement the function or the full program from ...


0

Iterative Quine


1

Follow the border


12

Sidestepping in a theorem-proving challenge A theorem-proving challenge is about proving a statement (= constructing a value of the given type) given in a specific host language (designed for theorem proving, most likely Lean or Coq). One problem with this is that the host language may have various utilities that allow writing a "proof" that is not ...


1

tinylisp A minimalistic Lisp dialect. It has only 16 builtins, which makes it easy to pick up for a one-day chat event. But because Lisp is powerful, this small set of builtins can be combined to solve a wide variety of tasks. tinylisp is particularly good at functional programming and list manipulation.


0

Balanced Bracket Sequence


3

Revert Flow Free puzzle


1

It depends Getting challenge ideas (be it a sub-task or a variant) from an existing challenge is perfectly fine. IMO you don't need any kind of explicit permission, as long as you specify in your challenge where you got your inspiration from. The only things that actually matter are: Is the new challenge interesting enough on its own? Is it significantly ...


3

Volume of a 3d model In this challenge, you'll take a shape as input, consisting of a number of triangles forming an outer shell. Your task will be to find the volume of the resulting shape. You can assume the triangles all connect to exactly one other triangle per side, and the surface does not cross over itself. You will not get an input where two separate ...


0

Optimize my Cruise Control My cars cruise-control functionality has 4 different methods of adjustment, all using a single stalk. They are as follows: Hard press up (press until you feel the click): +5 mph Soft press up (press lightly, but not to the click): +1 mph Soft press down (press lightly, but not to the click): -1 mph Hard press down (press until ...


0

Hearts KotH king-of-the-hill Your challenge, should you choose to accept it, is to write a Java bot to play a simplified version of hearts. Hearts is a four-player trick-based card game. To start a round of hearts, each player is dealt 13 cards. The player who has the two of clubs starts by playing the two of clubs. Going around the circle each player plays ...


0



17

I dislike our current stance on "serious contenders" TL;DR: we don't make it clear enough that answers with self-imposed restrictions are valid From my conversations with moderators, from posts by former moderators and just from my own anecdotal experience, I've realised that our moderators spent a decent chunk of their time deleting "invalid&...


8

My Perspective This is not a complete answer, it's just offering my perspective. It leans towards suggesting action, but I'd rather let other people speak before we are done here. I'm putting it here to not clutter up the post. In my experience as moderator, of the non-serious contenders (which were flagged as such) there are broadly three categories: ...


3

Converting Pinyin to Zhuyin or vice versa Challenge Pinyin and Zhuyin are systems that are used to help people pronounce characters in Mandarin Chinese. Write a function/program that converts Pinyin to Zhuyin or vice versa (clarify which one you are doing) according to the tables below. You are not required to deal with tones or incorrect inputs (including ...


-4

Reimplementing If code-golf While I was working on an answer to this puzzle, I managed to reimplement if without using any keywords. That inspired me to challenge you to make an if statement without using any reserved keywords. Criteria The code must be a function that takes a boolean and a callback (that disqualifies any languages that can't take callbacks)....


4

We generally want challenges to be open to all languages. However when you have a good reason restrict a challenge to a particular language you should. When it comes to "What is the shortest way to prove this theorem?", I don't think there is a good way to express that idea in a language agnostic way, and it seems like you are struggling with the ...


6

List of all Lean solutions posted in October 2021 (First time posters highlighted in bold) Replace twos with threes by Wheat Witch Is it a row of Pascal's triangle? by Wheat Witch What an Odd Function by Wheat Witch ∀ a b. a + b = b + a by Anders Kaseorg ∀ a b. a + b = b + a by Mario Carneiro Lean golf: Pascal vs. Fibonacci by Anders Kaseorg Lean golf:...


1

300+ rep for any nontrivial code golf answer in Lean or Coq Partially influenced by the LotM of October 2021 (Lean), but not limited to this period. Coq and Lean are academic languages mainly designed to establish and prove mathematical theories. Due to their type-theoretic and logical nature, they are NOT Turing-complete (any function should have some kind ...


0

code-golf Halve Code Regen TODO: This is a horrible title. Your challenge is to write a program, and when I half the program, the output must stay the same. Then, I will halve it and add the last two characters, and the output should be the same with the program's last two characters at the end. Sometimes the code can't be halved evenly, and when that ...


0

Irreducibile Polynomials in progress todo, add several test cases. and figure out how to deal with verifying answers. figure out how references work, not just using plain hyperlinks. As you may know, Polynomials are mathematical expressions of the sum of a variable raised to various powers and multiplied by various coefficients. For example consider the ...


0

fastest-code Write an interpreter for "MathScript" I had an idea for a new language, it's called MathScript! I got the idea from Mathematica. Basically, this is how it works: Functions are called by using the following syntax: FunctionName{some, arguments, separated, by, commas} The builtin functions are Display, Add, Sub, Mul, IntDiv, FloorDiv, ...


0

Draw me a circle Given a radius \$r\in\mathbb{N}\$ and \$r\geq 3\$, draw an ASCII circle for me, using \$x\$'s. Your circle does not have to look perfect, it just has to be identifiable as one. To make the circle look good, you have to use a \$2:1\$ ratio for width and height of the circles. This is due to characters being taller than wide. One thing that is ...


1

Well, Alan comes from my favorite animator Alan Becker, and Bagel is one of my favorite foods. Simple as that.


2

Khinchin's constant bad estimate


-1

king-of-the-hill Tac-Tok-Toe Tac-Tok-Toe is just like tic-tac-toe, but instead of three in a row, the winning condition is three in a row but each letter is exactly one space apart horizontally, vertically, or diagonally. The win can also go in any direction. The games Each team (X and O) will make their own tac-tok-toe AI's. 10000 games will be played. The ...


5

Underappreciated posts As part of blog posts, we'll demonstrate some of the more unappreciated posts on the site, and we highly recommend you check them out and give them an upvote. These were nominated by various users, and if you think you've found an answer that deserves more appreciation, feel free to drop a link to it in the CGCC Blog chat room. Dingus'...


1

Multiplication for geometric algebra


0

Drop down the numbers


Top 50 recent answers are included