instruction_seed
stringlengths
34
53.1k
_source
stringclasses
1 value
Challenge Write a full program/function to Demolish a given building at the rate 1 floor per second. INPUT Input is a building through STDIN(or whatever is called in your language) or through an ARGUMENT of a function. t=0 s | |#| {#} |# #| |# # #| |# # #| |# # #| TTTTTTT input consists of : | marks sta...
stackexchange_codegolf
Negadecimal, also known as base -10, is a non-standard positional numeral system. Take the number \$1337_{10}\$. In decimal, this has the value one thousand three hundred thirty seven, and can be expanded to: $$1\cdot10^3+3\cdot10^2+3\cdot10^1+7\cdot10^0$$ $$(1000)+(300)+(30)+(7)$$ In negadecimal, instead of \$10^n\$, ...
stackexchange_codegolf
Description Given an object (json), write code to extract all the keys from it. This is a question that I really wanted to ask everybody for a long time ago but I did not have time to write it up. It can be helpful in some cases in your daily work. Rule: You can use any parse function to get the JSON object, it does n...
stackexchange_codegolf
The accepted winner is isaacg, with his 7-bit ASCII answer. However, the challenge isn't over yet - this bounty is awarded to the shortest answer. If, somehow, you get all the first characters of all the other answers down into 10 bytes, you will win the bounty. This includes all the characters from Round 2's GolfScrip...
stackexchange_codegolf
This is a cops-and-robbers challenge. The robbers' thread is here. An interesting question to think about is the following: If I have a sequence of numbers how many of them do I have to provide before it is clear what sequence I am talking about? For example if I want to talk about the positive integers in order star...
stackexchange_codegolf
World Bowling scoring Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores. World Bowling has introduced a simplified scoring system in order to attract more people to the sport. This scoring system is utilized in internation...
stackexchange_codegolf
Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right. When you finish writing a word, change the direction and only then...
stackexchange_codegolf
You have a bunch of cities on a grid which you wish to link up. Roads can be placed on any tile that doesn't contain a city, and connect to all roads or cities adjacent to them, vertically, horizontally or diagonally. Roads can link up via cities, for example C \ C-C is fully linked up. However, there are some moun...
stackexchange_codegolf
Background I feel that for a site named code-golf we have a shockingly little amount of golf being played. Let's fix that. Challenge Determine whether the hole of a minigolf course can be reached after exactly a certain number of movements and whether it can be reached at all. How to play Inputs are an integer "power l...
stackexchange_codegolf
Challenge Create a function that takes an string as a parameter. (Easy as far) This string will contain Single digit numbers Letters from the alphabet Question marks (Of course) Your function will check if there are exactly 3 question marks between every pair of two numbers that add up to 10 or more. If so, then your...
stackexchange_codegolf
This is inspired by the excellent Visualize Visual Eyes challenge. It is posted with permission from and credit to @Jordan We are going to create an ASCII art approximation of the Xeyes challenge but without worrying about the actual mouse movements. Just the positions. EDIT I thought about whether this could be seen a...
stackexchange_codegolf
Background Slowsort is an in-place, stable sorting algorithm that has worse-than-polynomial time complexity. The pseudocode for Slowsort looks like this: procedure slowsort(A[], i, j) // Sort array range A[i ... j] in-place. if i ≥ j then return m := floor( (i+j)/2 ) slowsort(A, i, m) ...
stackexchange_codegolf
The Steenrod algebra is an important algebra that comes up in algebraic topology. The Steenrod algebra is generated by operators called "Steenrod squares," one exists for each positive integer i. There is a basis for the Steenrod algebra consisting of "admissible monomials" in the squaring operations. It is our goal to...
stackexchange_codegolf
4, 32, 317, 3163, 31623, 316228, 3162278, 31622777, 316227767, 3162277661, 31622776602, 316227766017, 3162277660169, 31622776601684, 316227766016838, 3162277660168380, 31622776601683794, 316227766016837934, 3162277660168379332, 31622776601683793320, 316227766016837933200, 3162277660168379331999, 31622776601683793319989...
stackexchange_codegolf
Part 1 of the challenge revolved around converting the letters into specific unicode characters. Lore In this part we receive the output from the function made in Part 1, which now has to be arranged in an artistic manner. Aim Take 1 word as input which has already undergone transformation in the function made in Part ...
stackexchange_codegolf
Note: The survey for community favorite will be released soon In this KoTH, the aim is to be the last bot alive. Coins will be placed in random areas, and your bot must get the coins first. If a bot runs into another bot, the bot with more coins wins, and the other bot dies. More details below. Coin types There will ...
stackexchange_codegolf
Your task is to accept as input two "ASCII Art"s, and align each piece of art next to each other horizontally. For example, say you have two strings, "abc\ndef" and "123\n456". You need to align them horizontally to produce the string "abc123\ndef456". I'm calling this "aligning horizontally" because while the inputs, ...
stackexchange_codegolf
Output the Nth term of the Van Eck Sequence. Van Eck Sequence is defined as: Starts with 0. If the last term is the first occurrence of that term the next term is 0. If the last term has occurred previously the next term is how many steps back was the most recent occurrence. https://oeis.org/A181391 https://www.you...
stackexchange_codegolf
Tetration, represented as \${}^ba\$, is repeated exponentiation. For example, \${}^32\$ is \$2^{2^2}\$, which is \$16\$. Given two numbers \$a\$ and \$b\$, print \${}^ba\$. Test cases 1 2 -> 1 2 2 -> 4 5 2 -> 3125 3 3 -> 7625597484987 etc. Scientific notation is acceptable. Remember, this is code-golf, so the code w...
stackexchange_codegolf
Thanks to your help in the Mark My Mail challenge, PPCG-Post has successfully stamped all of its parcels with the generated barcodes! Now, it's time to decode them. In this challenge your program will, given a barcode generated from the Mark My Mail challenge, decode it and return the encoded integer. But watch out! Th...
stackexchange_codegolf
Background You 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 operator is sick and requires you to cover for them. They left you the following note: Things work a little differently with...
stackexchange_codegolf
You have N lists A = [5, 6, 10, 15] B = [3, 0, 7, 4] C = [49, 59, 29] D = [19, 29, 39] E = [9, 15, 3, 10] You have to combine them such that: Two lists which have a common elements they should be next to each other. In this case answer is: A,E,B,C,D [5, 6, 10, 15, 9, 3, 0, 7, 4, 49, 59, 29, 19, 39] E comes after A a...
stackexchange_codegolf
After you wake in a dark room, you see a rectangular grid of lights with corresponding switches. You decide to use a coordinate system with the bottom left light representing (1,1) and the coordinates increasing as you go up (y direction) and to the right (x direction). The grids are identical in that flipping the swi...
stackexchange_codegolf
This is a simple one: print an ASCII Gantt chart. Given tasks' ranges (start-time - end-time Tuples), print a Gantt timeline in the form of - characters for each task duration - each task in a new line. Example Say my tasks ranges are 28->35, 34->40, 39->44, the Gantt will look like this: --...
stackexchange_codegolf
Two numbers are considered amicable if the proper divisor sum of the first is the same as the second number, the second number's proper divisor sum is equal to the first number, and the first and second numbers aren't equal. \$s(x)\$ represents the aliquot sum or proper divisor sum of \$x\$. 220 and 284 are amicable be...
stackexchange_codegolf
Stack Cats is a reversible, stack-based language. Its reversible nature makes for somewhat weird loops. This challenge is about the conditional loop (...). When these loops are nested in certain ways, it's possible to transform the code to reduce the nesting depth. Here are the rules (where A and B stand for an arbitra...
stackexchange_codegolf
Write a function or program that accepts a date (as a string in YYYY-MM-DD format) as input and returns a truthy value if that date is "alphabetical," and a falsey value if it isn't. An alphabetical date is a date whose month, day and year are in alphabetical order when expressed as a string (and when considered speci...
stackexchange_codegolf
Related: Calculate Power Series Coefficients Given a positive integer \$X\$ and a max exponent (Also a positive integer too) \$N\$ calculate the result of a power series. Example: $$X^0+X^1+X^2+\cdots +X^N$$ Assume \$(X + N) \le 100\$ Test Cases 1 2 => 3 2 3 => 15 3 4 => 121 2 19 => 1048575 Standard code-golf ...
stackexchange_codegolf
On most new-years challenges when it is currently not the corresponding year of the challenge, It says this in the front. It's [current year] already, folks, go home. You have to output this text with the current year substituted. I/O Input: None. Output: It's [current year] already, folks, go home.
stackexchange_codegolf
Your task is to print the titles of the questions with the five highest scores (upvotes minus downvotes) here on CodeGolf.SE, while skipping over any closed, locked and on-hold questions. Currently these are: Produce the number 2014 without any numbers in your source code Showcase your language one vote at a time Ameri...
stackexchange_codegolf
Introduction In this challenge, your task is to decide whether a given sequence of numbers can be separated into two subsequences, one of which is increasing, and the other decreasing. As an example, consider the sequence 8 3 5 5 4 12 3. It can be broken into two subsequences as follows: 3 5 5 12 8 4 3 Th...
stackexchange_codegolf
A followup to this challenge by Jeremy Collprav, inspired by DLosc solving this in Regenerate. Some sections copied from the linked challenge. Linking chains We define a chain to be a string containing exactly one or more of only the - character, or 1 or more of only the _ character, or two chains linked by a =. More f...
stackexchange_codegolf
Background Hex is a two-player abstract strategy game played on a K×K rhombus of hexagonal tiles. Two opposite sides of the rhombus are colored white, and the other two black, and the two players, black and white, take turns in placing a token of their color on an unoccupied tile. The player who first manages to constr...
stackexchange_codegolf
INPUT: 10 random numbers each number is greater than 0 and less than 100 list of numbers is presorted, lowest to highest the list will not contain any duplicate numbers CHALLENGE: Write a function that would take in the numbers, and return the count of the longest group of consecutive numbers. EXAMPLE OUTPUT: 1 2 33 ...
stackexchange_codegolf
I'm a narcissist. (Not Really) I'm also very lazy... (Not Really) So I want to know the score of this question, and how many people have viewed it. But I'm too lazy to check myself... Challenge Your challenge is to output the score of this question, and how many views there are. No input may be taken, and output may...
stackexchange_codegolf
Let's consider a list \$L\$ (initially empty) and a pointer \$p\$ into this list (initialized to \$0\$). Given a pair of integers \$(m,n)\$, with \$m\ge 0\$ and \$n>0\$: We set all uninitialized values in \$L\$ up to \$p+m+n\$ (excluded) to \$0\$. We advance the pointer by adding \$m\$ to \$p\$. We create a vector \$[...
stackexchange_codegolf
In this challenge, you'll create some programs which behave similarly to genes. When you run one, it will return one of its two "alleles" (a half of its source code), and concatenating any two alleles from your programs will result in a new, functioning program (which returns its own alleles). As an example, say you wr...
stackexchange_codegolf
Input An integer k composed of 1 and 2, with at least 3 digits and at most 200 digits. Output Another integer k' obtained by removing at most one (could be none) digit from k, such that k' is composite, and then another integer p for a non-trivial (that is, not 1 or k') factor of k'. Test Cases 121212 -> 121212 10101 1...
stackexchange_codegolf
In combinatorics, the rook polynomial \$R_{m,n}(x)\$ of a \$m \times n\$ chessboard is the generating function for the numbers of arrangements of non-attacking rooks. To be precise: $$R_{m,n}(x) = \sum_{k=0}^{\min(m,n)} r_k x^k,$$ where \$r_k\$ is the number of ways to place \$k\$ rooks on an \$m \times n\$ chessboard ...
stackexchange_codegolf
There are 3 (commonly used) trigonometric functions sin cos and tan each of these functions has an inverse function You goal is to write 3 programs or functions (one for each inverse trigonometric function asin acos atan) that take a (real) number a input and return the result of the corresponding inverse trigonometric...
stackexchange_codegolf
Binary trees A binary tree is a tree with nodes of three types: terminal nodes, which have no children unary nodes, which have one child each binary nodes, which have two children each We can represent them with the following grammar, given in BNF (Backus–Naur form): <e> ::= <terminal> | <unary> |...
stackexchange_codegolf
Introduction From Wikipedia: A tessellation of a flat surface is the tiling of a plane using one or more geometric shapes, called tiles, with no overlaps and no gaps. A fairly well known tessellation is shown below: The rhombi are tiled in a fashion that results in no overlaps or gaps, and simulates interchanging c...
stackexchange_codegolf
When you leave, my challenges fade to grey, 0A0AE16, 0A0A0AE16... A while ago, I made this programming language (https://esolangs.org/wiki/Dragostea_din_tei) which uses an interesting number system. It is base two for integers, but for decimals it divides a base two integer by a power of ten. The input should be a floa...
stackexchange_codegolf
Problem Let's define a generalized Cantor set by iteratively deleting some rational length segments from the middle of all intervals that haven't yet been deleted, starting from a single continuous interval. Given the relative lengths of segments to delete or not, and the number of iterations to do, the problem is to w...
stackexchange_codegolf
Goal Write a program or function that returns the day of the week for a date, eg. 01/06/2020 -> Mon However, it's unknown if the date is in the format mm/dd/yyyy or dd/mm/yyyy. If you can be certain of the day of the week, return it. If there is uncertainty, return an error. 02/07/2020 -> Err (Thu? Fri?) Input...
stackexchange_codegolf
A common year is a year that is not a leap year and where the first and last day of the year are on the same day. A special common year is one that starts on a Monday and so ends on a Monday as well. Your challenge is to create a program/function that when given a year as input finds the nearest special common year, o...
stackexchange_codegolf
Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details. While other Elves are busy carrying air blowers, Fen comes and shouts, "I've got a spell for this job!" To recap, a chimney is modeled as a rectangular grid. The number in each cell represents the amount of smoke in the region. The lef...
stackexchange_codegolf
Description : Given an array of strings representing a grid of cells With the key : 0 = 'dead cell' 1 = 'live cell' write a function that returns the next iteration following the rules of Conway's Game of Life . Rules Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. Any live ...
stackexchange_codegolf
Given 2 positive integers in any format you'd like, return their sum using only logic gates and bit shifts (see example below). Don't worry about overflow. EDIT: Using pre-written addition is obviously not allowed. So no a + b, Add(a, b), a - (-b) etc. This is code golf, so standard loopholes apply. Shortest program in...
stackexchange_codegolf
Version 2 here. Simple challenge: given an integer, draw a house of cards with the given number of stories. If the number is negative, draw the house upside-down. Examples: Input: 2 Output: /\ -- /\/\ Input: 5 Output: /\ -- /\/\ ---- /\/\/\ ------ /\/\/\/\ -------- /\/\/\/\/\ Input: 0 Output...
stackexchange_codegolf
It's time for another Mesoamerican calendar! The Xiuhnelpilli was used by the Aztecs (more properly, the Mexica) to name their years. Each year has a number and a sign. Here's part of the cycle: Input; Output 1089; 13 Calli 1090; 1 Tochtli 1091; 2 Acatl 1092; 3 Tecpatl 1093; 4 Calli 1094; 5 Tochtli 1095; 6 Acatl ...
stackexchange_codegolf
World Time Conversion Challenge: Given an initial clock time in UTC and a list of countries: for each country in the list, output the local time it is in that country based on the initial time. In cases where a country is big enough to have multiple local time zones (like the United States), you may output any valid l...
stackexchange_codegolf
In this challenge, your past self comes back to help or hurt someone else! The task is simple: write a full program, not a function, that prints the first code submission on this site submitted by the previous user, in the language of your first answer. (In the case that your first answer was purely prose, for example ...
stackexchange_codegolf
The Chinese Remainder Theorem tells us that we can always find a number that produces any required remainders under different prime moduli. Your goal is to write code to output such a number in polynomial time. Shortest code wins. For example, say we're given these constraints: \$n \equiv 2 \mod 7\$ \$n \equiv 4 \mod ...
stackexchange_codegolf
The title is an homage of the Natural Number Game, which is a nice interactive tutorial into proving certain properties of natural numbers in Lean. The definitions used in Lv1 will be reused here. I've done some improvements: Now it starts with import tactic, which means you can freely use powerful mathlib tactics. I...
stackexchange_codegolf
Challenge Create a function takes in two 2-dimensional arrays of characters (or strings if the programming language does not have characters as a datatype) as inputs: a and b. If your language does not support these inputs, you may use any other standard one-byte variable. Your task is to determine if b contains a. If ...
stackexchange_codegolf
Background We will be using a 3x3 cube for this challenge. Rubik's cubers have their own notation for movements on the cube: Each of the 6 faces has a clockwise turn notated with a single capital letter: UDLRFB. There are three additional letters MES denoting the three center slices. Counterclockwise rotations have a ...
stackexchange_codegolf
Given the battery level L in the range 0-5, your code should draw the following ASCII art. When L=0: ############ # ### # ### # ### ############ When L=1: ############ ### ### ### ### ### ### ############ When L=2: ############ ##### ### ##### ### ##### #...
stackexchange_codegolf
In honor of national pi day, create a program that, when given an integer, n, as input, will create a circular "pie" constructed of these smaller pies: Your program should output the image in a closed polygonal shape, and the number of outputted images should be equal to the value of the nth digit of pi. Below are som...
stackexchange_codegolf
You need to print A-Z like this: 1. A 2. B 3. C 4. D 5. E 6. F 7. G 8. H 9. I 10. J 11. K 12. L 13. M 14. N 15. O 16. P 17. Q 18. R 19. S 20. T 21. U 22. V 23. W 24. X 25. Y 26. Z But your source code cannot use 1,2,4,6. Trailing newlines in output allowed,, but leading ones not allowed. Standard loopholes apply, shor...
stackexchange_codegolf
Simple challenge inspired by the popularity of my previous print invisible text and print real invisible text challenges, and the same length different string challenge. Given a string consisting of only printable characters (0x20 to 0x7E), print every printable character not present in the string. Input A string, or a...
stackexchange_codegolf
The task here is simple: given a target location on an XY grid, and a rectangle on that grid, find the length of the shortest path from the origin to the target which does not intersect the rectangle. All parameter values are integers. You can assume that neither the target point nor the origin is inside or on the bord...
stackexchange_codegolf
The task is simple, given an integer n of how many lines the next n lines is and, a multi-line input, output the resulting 90 degree tilted grid in a clockwise formation. E.g. Input: 2 c d o e Output: o c e d I/O format: Input will have spaces in between them Input always contains alphabetical characters except the ...
stackexchange_codegolf
The sequence A109648 starts with the following numbers 53, 51, 44, 32, 53, 49, 44, 32, 52, 52, 44, 32, 51, 50, 44, 32, 53, 51, 44, 32, 52, 57, 44, 32, 52, 52, 44, 32, 51, 50, 44, 32, 53, 50, 44, 32, 53, 50, 44, 32, 52, 52, 44, 32, 51, 50, 44, 32, 53, 49, 44, 32, 53, 48, 44, 32, 52, 52, 44, 32, 51, 50, 44, 32, 53, 51, 4...
stackexchange_codegolf
Description : Given a string as input, check if it is a valid ordinal number in English or not. If it is valid return truthy value otherwise return falsy value. (Suggested by @Arnauld. Thanks . Also by @JoKing) For users who want to know about ordinal numbers go here : https://www.mathsisfun.com/numbers/cardinal-ordina...
stackexchange_codegolf
Make a cat program, with a catch. The program must refuse under all circumstances to output "Hello World", instead outputting "Goodbye World", with matching spacing (but matching casing is not required). "Hello World" must never appear as a substring of the output, regardless of casing, not even if the two words are (o...
stackexchange_codegolf
Your task is to implement an Enigma encryption machine. Your program will accept the machine initialization information followed by a string of text to be encrypted. Initialization vector will be Rotors used (Left to right). Will be three characters. Rotors 1-5 are valid. Initial rotor settings (A-Z) Left to right. R...
stackexchange_codegolf
Balancing Act A see-saw (supposedly from the French 'ci-ça', meaning 'this-that') forms a third of the holy trinity of playground equipment, along with the similarly ubiquitous slide and swing. A see-saw is in perfect balance if, and only if, the sum of the moments on each side are equivalent. A see-saw can therefore b...
stackexchange_codegolf
Intro There are 3 nails in the wall. You've got a piece of string that is fixed to the picture frame with both ends. To hang the picture, you entangled the string with the nails. But before letting the picture go: Can you predict whether the image is going to fall, just by looking at how the string is wrapped around th...
stackexchange_codegolf
Write a program or function that, given a string, will strip it of zalgo, if any exists. Zalgo For this post, zalgo is defined as any character from the following Unicode ranges: Combining Diacritical Marks (0300–036F) Combining Diacritical Marks Extended (1AB0–1AFF) Combining Diacritical Marks Supplement (1DC0–1DFF) ...
stackexchange_codegolf
Subleq is a Turing-complete esolang with only one instruction, SUBLEQ. This instruction takes in three parameters, A, B, and C, all of which are memory addresses. The instruction subtracts the value in memory address A from that in memory address B, storing it in address B. If the value at B is now less than or equal t...
stackexchange_codegolf
This is what we'll call a bowl of alphabet soup - a roughly circular ascii-art shape with the 26 uppercase English letters (A-Z) arranged clockwise to form the perimeter: XYZABC VW DE U F T G S H RQ JI PONMLK Write a program that takes in a single letter character, A-Z, and...
stackexchange_codegolf
The above image displays a hexagonal grid of hexagons. Each cell in the grid is assigned an index, starting from the center and spiraling counterclockwise around as shown. Note that the grid will continue indefinitely - the above picture is simply the first section. The next hexagon would be adjacent to 60 and 37. You...
stackexchange_codegolf
There is a well known question here that asks for a short (least characters) fibonacci sequence generator. I would like to know if someone can generate the first N elements only, of the fibonacci sequence, in very short space. I am trying to do it in python, but I'm interested in any short answer, in any language. F...
stackexchange_codegolf
In a 9 by 9 grid some points have been marked. The task is it to make a program that counts all distinct squares that can be made using four marked points. Note that squares can also be placed diagonally (any angle). Input can be one of the following: A character string of length 81 containing two distinct characters ...
stackexchange_codegolf
In any programming language, create a program that takes input and animates the text being typed on a keyboard. The delay between each character should be varying to simulate true typing on a keyboard. The delay shall be 0.1, 0.1, 0.5, 0.1, 0.1, 0.5 ... seconds, until the last character is printed. The final output sha...
stackexchange_codegolf
The trumpet is a valved aerophone instrument, usually pitched in B♭. The sound is made when the player vibrates their lips to displace air inside the instrument. That vibration is acquired by setting one's mouth in a specific way, called the embouchure. Different embouchures, with tighter or looser lips, produce differ...
stackexchange_codegolf
Tonight, 31 January 2020, Brexit will happen and the United Kingdom will leave the European Union, the first time that the number of EU member states will decrease. Your job is to take a date and output the number of EU1 members on that date, according to the following table: | Start | End | Number of memb...
stackexchange_codegolf
Unfortunately one of the greatest comic book writers passed away yesterday afternoon. Lots of Hollywood stars, musicians, actors, and many other people are paying tribute to this awesome writer, so we must do something as well. Challenge Print The Avengers Logo Note: You may use any other character in place of # othe...
stackexchange_codegolf
Task Given a string s, output a truthy value if the ASCII code of each letter is divisible by the length of s, and a falsey otherwise. Input/Output Input is a nonempty string containing only ASCII [32-126]. Output is a standard truthy/falsey value. Note that you can switch the values, for example returning 0/False if d...
stackexchange_codegolf
You are provided a set of arbitary, unique, 2d, integer Cartesian coordinates: e.g. [(0,0), (0,1), (1,0)] Find the longest path possible from this set of coordinates, with the restriction that a coordinate can be "visited" only once. (And you don't "come back" to the coordinate you started at). Important: You cannot "p...
stackexchange_codegolf
My apologies for the wordiness. We had fun with it at work in our internal golfing, but it required a few emails for clarification, so I hope I captured most of that the first time. PROBLEM Given a “simulated” snowfall snapshot (as a string, stdin or parameter to your function/method), report on 4 values: minimum depth...
stackexchange_codegolf
Input The input is a single positive integer n Output The output isn with its most significant bit set to 0. Test Cases 1 -> 0 2 -> 0 10 -> 2 16 -> 0 100 -> 36 267 -> 11 350 -> 94 500 -> 244 For example: 350 in binary is 101011110. Setting its most significant bit (i.e. the leftmost 1 bit) to 0 turns it into 001011110...
stackexchange_codegolf
First 15 numbers of the A046173: 1, 99, 9701, 950599, 93149001, 9127651499, 894416697901, 87643708742799, 8588189040096401, 841554882220704499, 82463790268588944501, 8080609891439495856599, 791817305570802005002201, 77590015336047156994359099, 7603029685627050583442189501 Your task is simple, output the first 20 numbe...
stackexchange_codegolf
Background: the Ramsey number \$R(r,s)\$ gives the minimum number of vertices \$v\$ in the complete graph \$K_v\$ such that a red/blue edge coloring of \$K_v\$ has at least one red \$K_r\$ or one blue \$K_s\$. Bounds for larger \$r, s\$ are very difficult to establish. Your task is to output the number \$R(r,s)\$ for ...
stackexchange_codegolf
The reason for this question is because I made a deadlineless bounty and I need a tips question to link in the bounty Vyxal 3 is the third major version of the Vyxal golfing language. As it is significantly different to Vyxal 2, the tips there don't apply. Therefore, what tips and tricks do you have for golfing in Vyxa...
stackexchange_codegolf
An aesthetically pleasing divisor tree is a tree of divisors of input n that, for any composite number m, has two children nodes that are the pair of divisors that are closest to the square root of m. The left node should be the smaller divisor of m and the right node should be the larger divisor of m. A prime number i...
stackexchange_codegolf
Write a program that takes a string as input and modifies it by reversing the string in its place by mirroring the position. The first position goes to last, second to second last and so it goes on. In simple words, the string would be mirrored. "In Place" means the program should use \$O(1)\$ additional memory regardl...
stackexchange_codegolf
Edit: I will be posting a newer version of this question on meta-golf soon. Stay tooned! Edit #2: I will no longer be updating the challenge, but will leave it open. The meta-golf version is available here: https://codegolf.stackexchange.com/questions/106509/obfuscated-number-golf Background: Most numbers can be writte...
stackexchange_codegolf
It's simple, simply output text to STDERR containing the string EOF. Input/Output Your input will be none; however, you should output the message to STDERR. Rules Since this is code-golf, the shortest answer wins. No standard loopholes please. Any method approved by Standard I/O is allowed. Your code may not contain t...
stackexchange_codegolf
Sandboxed Given a set of closed non-overlapping 2d contours (separated by at least one space even on diagonals) with arrows oriented consistently in the same clockwise or counter-clockwise direction (each contour has its own direction) and a positive number n, move the arrows n steps along the contours in the respectiv...
stackexchange_codegolf
To increase data safety at our company, we are planning to start using Gray code numbers (where successive values differ by only one bit) instead of classical binary ones. Please help us to make a program that converts numbers to Gray code (single number to single number), but the program needs to be safe as well. This...
stackexchange_codegolf
This is an exact inverse of the question Convert to Spoken Binary. This introduction is copied from there. Introduction In the video the best way to count, binary is proposed as the best system of counting numbers. Along with this argument is a proposal on how to say numbers in this system. First, we give names to eac...
stackexchange_codegolf
The challenge is to create the classic Snake game using as few bytes as possible. Here are the requirements: The game must be implemented in a typical 2-dimensional layout. The snake should be able to grow significantly within the bounds of the map (this really means, don't make your map too small, use your discretion...
stackexchange_codegolf
The challenge is to implement a function or program that takes two numbers, \$x\$ and \$y\$ and return the result of \$x^y\$. The program cannot use any other mathematical operation other than \$+\$ or \$-\$, so no multiplication or division. Functions built into languages are also not allowed. The code in the least a...
stackexchange_codegolf
Stack Cats is a reversible, stack-based language. Its reversible nature makes for somewhat weird loops. This challenge is about the conditional loop (...). When these loops are nested in certain ways, it's possible to transform the code to reduce the nesting depth. Here are the rules (where A and B stand for an arbitra...
stackexchange_codegolf
Overview The cover of a book will be provided in the following ASCII format: ______ | | | | | | | | ------ The input can be in any reasonable format (eg. a list of strings, a nested list of characters, etc.) Inside the "borders" of the cover, other printable ascii characters might appear, which contribute ...
stackexchange_codegolf
Cops challenge The Robbers' Challenge Find a vulnerable answer. That is, an answer which hasn't been cracked yet and which isn't safe yet either. Crack it by figuring out its language. That is, find any language in which the given program is a valid program (subject to the rules outlined in the Cops' Challenge above)...
stackexchange_codegolf
Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number is evil. Challenge Your job is to write a full program or function which accepts a single, non-negative integer as input...
stackexchange_codegolf
Thanks to FryAmTheEggman for the idea for this second version. Version 1 here. Not-so-simple challenge: given a number of cards, build the biggest house of cards you can with that number of cards, according to the following building order: /\ /\ /\ /\/\ ...
stackexchange_codegolf