Split the atom
Input: 0 >= X >= 2³² - 1
Output: List of numbers in decimal, after recursive splitting in binary format.
Explanation:
Input: 255
Current Output is 255.
Binary representation of 255 is 1111 1111. Splitting it, we get 1111 and 1111, which in decimal are 15 and 15.
Continuing...
Did someone bite my sandwich? codegolf
Yesterday, I left my sandwich on the table. When I got up today, there was a bite in it... Was it mine? I can't remember...
Problem:
Take a representation of my sandwich and my bite pattern and see if it was my bite or not.
Examples:
1:
My bite pattern...
There was recently (a few years back) some buzz on programming websites about an implementation of Tetris in 140 Bytes.
...
It turns out that although it is small, it is a simplified version of Tetris, and not even a complete implementation. Only the core logic function fits in 140 bytes of Java...
@anyonewhocares I'm wondering if it's possible to make Charcoal golfier - would there be any advantage to making it stack-based (or other memory model) or tacit?
How long is my number? Restricted version
code-golf number restricted-source
Challenge
Given an real number, Z in the range -(2^100) ≤ Z ≤ 2^100, output the number of digits in that number (in base 10).
Rules
You must not use any string functions. You are not allowed to store the number as a...
Quickie here, you can see I'm new to PCG so I wasn't sure what keywords to search to get to the appropriate documentation. Also VBA has relatively little info availible as it is
If I type into the immediate window, several things are returned, I want to know the byte count of what is returned (p...
Remove character at specified index
code-golf string
(Meta: have we had this challenge before?)
(heavily inspired by Element of string at specified index)
Given a string s and an integer n representing an index in s, output s with the character at the n-th position removed.
0-indexing and ...
What are the rules for counting bytes in the immediate window? I have found very little in the way of VBA docuimentation to try and help with this, because is seems to be a relatively uncommon golfing language. For clarity, I'm not sure how the rules would be applied in a few test cases below, an...
My friend: "How much rep do you have on PPCG?" Me: ">4000" Him: "You have no life..." Me: *opens up Dennis's and Martin's profiles* Him: "Okay never mind"
How old am I?
Create a function or program that when given a date outputs the age of that person in years from today's date.
Input
Input is given as a date in any reasonable format, this can be a string, a date object, different parameters for year, month, day etc.
Output
Output is an intege...
I saw this recent Puzzling question:
Add parentheses to make this true
And saw that one answer used a Python script to try all possibilities.
Your challenge is, given an expression (as a string) and an integer, is to make a program that can tell whether you can add parens to make the expressi...
Pi - The Movie!
Introduction
So we've had the musical version The Sound of Pi, now its time for the movie.
Challenge
Your challenge is to write a full program or function that outputs an animated version of pi to 100 decimal places.
For your convenience, here's Pi to 100 decimal places
3.14...
code-challenge ? answer-chaining fibonacci rosetta-stone
Answer-chaining: Output the nth Fibonacci item with that much source?
Your program must output the nth value in the Fibonacci sequence and it's source code must be n long. (Trailing whitespace in output allowed.) Example 1st program:
# [...
@programmer5000 if it were fibonacci week, we'd need to release 1 fibonacci challenge on monday, 2 on tuesday, 1 on wednesday, one on thursday, and one on saturday
Given a list of integers, output every possible partitioning of the list where each partition is a non-empty sublist.
So for the list [1, 2, 3, 4] the result is:
[[1, 2, 3, 4]]
[[1, 2, 3], [4]]
[[1, 2], [3, 4]]
[[1, 2], [3], [4]]
[[1], [2, 3, 4]]
[[1], [2, 3], [4]]
[[1], [2], [3, 4]]
[[1], [2],...
A Turing machine is an abstract machine that manipulates symbols on a strip of tape according to a table of rules; to be more exact, it is a mathematical model of computation that defines such a device. Despite the model's simplicity, given any computer algorithm, a Turing machine can be constructed that is capable of simulating that algorithm's logic.
The machine operates on an infinite memory tape divided into discrete cells. The machine positions its head over a cell and "reads" (scans) the symbol there. Then, as per the symbol and its present place in a finite table of user-specified instructions...
> The Turing machine mathematically models a machine that mechanically operates on a tape. On this tape are symbols, which the machine can read and write, one at a time, using a tape head. Operation is fully determined by a finite set of elementary instructions such as "in state 42, if the symbol seen is 0, write a 1; if the symbol seen is 1, change into state 17; in state 17, if the symbol seen is 0, write a 1 and change to state 6;" etc.
This site may have been built primarily on code-golf challenges and puzzles that have no winning criteria, but we have evolved away from that. Our name is outdated, and we should rebrand ourselves.
Because the folks in the chat cannot seem to agree on a name, I'm going to post multiple answers a...
Meme: Graduation
Originator: Geobits
Cultural Height: Sept. 26, 2014–Feb. 23, 2016
Background: Geobits, a known and "loved" user, tried to convince people that PPCG is set to graduate during PPCG's beta. An often used date is November 1st.
@EriktheOutgolfer They started being overrused, and then the Alex is wrong meme started being used to attack Alex and undermine his authority on the main site. And TNB was becoming extremely low quality/obsessed with some of the memes (specifically avocado)
Range, Reverse, Sum!
Given a positive integer n as input, output the reversed range sum of n.
A reversed range sum is created by making an inclusive range up to n, starting with 1 and including n, reversing each of the numbers inside, and summing it.
For an example, here is what would happen f...
WHAT IS THIS DOING HERE?
How low can you go? - Signal Limbo.
Sometimes we need a low voltage, sometimes we need a high voltage. Let's design a VDC power supply!
The challenge is simple, with 2 lines (+5V and GND), Create a Variable DC power supply on a standard breadboard that ranges from +12...
Solderless-Breadboards are very common to make and build electrical prototypes typically, they consist of rows, and each row has 5 holes. There are 2 columns of rows on a standard breadboard.
I want to introduce a new possible challenge. breadboard-golf.
Why should we allow these challenges?
...
> Clearly, we're not going to allow arbtirary puzzles or games or what have you, there are other sites for that. That being said, this challenge has a variety of features which put it in the programming camp:
Rigorously simulable - anyone can check the results. Complex input-output relationship. Different arrangements of components can have all sorts of effects. (Optional, but a nice bonus) Directly related to the wider world of programming through the world of circuitry design. This is programming in exactly the same sort of way that Brainfuck is: With enough time and effort, you could do…
tl;dr: since breadboards are TC (sorta), it's on topic
as long as you can score, check, and do stuff in it: it's allowed
From the Sandbox, 6 months in the making.
Sometimes we need a low voltage, sometimes we need a high voltage. Let's design a VDC power supply!
The challenge is simple, with 2 lines (+5V and GND), Create a Variable DC power supply on a standard breadboard that ranges from +12V (+/-0.1) to 0V.
I...