A ball is dropped and bounces. At each rebound, the ball reaches half the height of the previous rebound.
How high the ball must be dropped so it reaches exactly the height H after the sixth rebound?
Program my autodialer
Back in the day, telephone autodialers used punchcards with one column for each digit of the number to be dialed. The first three rows represented the numbers (1,2,3), (4,5,6), and (7,8,9) respectively. The last three rows rotated this: (1,4,7), (2,5,8), and (3,6,9). The mi...
Q: Is it acceptable to allow a proof of impossibility as an answer? E.g. "I think my challenge is insanely difficult. If you can prove it's impossible in language X, that still counts as a valid answer"?
@AdmBorkBork "Challenges that make you stop and think and actually work for them are best." I like the idea, but taking a trivial challenge and disallowing trivial answers is probably not the best way to go about that...
@DJMcMayhem The first 256 (À to ) are 1 byte 0x00 through 0xFF. However, if the byte is 0xFF, it takes the next hex value (let's say 0x03) and adds 256 to it, then indexes into the second half of the code page
Interesting. So it's really (from an encoding standpoint) not that different than jelly's two byte commands, just that they're all mapped to a two-byte one char for readability
@Pavel The middle button used to be every bit as big as the right button, instead of a pressable scroll wheel, so they were simply enumerated from left to right. I always have thought of the middle button as the second one, which is in part why I find the lack of it so disturbing.
From the top of my head, open links in new tabs (browser, file manager, etc.), close tabs, toggle fullscreen for my video player, show a window on all virtual desktops.
I might get mocked for saying this, but Opera has some really cool mouse shortcuts. For example, left-right quickly is next, and right-left quickly is previous. And also hold right-click: cursor down-right is close tab
[python3] I want to make a class where you can give it a dict and then obj.attr is the same as dict["attr"]; however, the problem is then that self.dict will throw it into an unending recursive loop. how do I do something like that?
CMC (maybe to main?): Make a "word icicle". Given a string matching [a-zA-Z]+, duplicate it on the line below, each time removing the alphabetically first letter and replacing it with a space. If there are multiple occurences of the same letter, replace the leftmost one first.
Reading the changes in Python 3.1, I found something... unexpected:
The sys.version_info tuple is now a named tuple:
I never heard about named tuples before, and I thought elements could either be indexed by numbers (like in tuples and lists) or by keys (like in dicts). I never expected the...
Precarious prefixes and suffering suffixes
We define the prefixes of an array to be the first n values in the array, where n increases between 1 and the length of the array. For example, the prefixes of the array [1, 2, 3, 4, 5] are [1], [1, 2], [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5].
The suf...
I created the programming language Pepe, which doesn't really score anything good in code-golf, but leaves a big space for better solutions. I decided to make a golfing language based on it, which wouldn't probably score anything good on string challenges, but would be very challenging to make it the shortest - like in BF, where you'd rebuild entire code to make it more optimal.
Knapsack Problem
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
Wikipedia for more information
For example you can be...
The quick brown fox jumped over the lazy dog
The quick brown fox jumped over the l zy dog
The quick rown fox jumped over the l zy dog
The qui k rown fox jumped over the l zy dog
The qui k rown fox jumpe over the l zy dog
The qui k rown fox jumpe over the l zy og
Th qui k rown fox jumpe over the l zy og
Th qui k rown fox jump over the l zy og
Th qui k rown fox jump ov r the l zy og
Th qui k rown fox jump ov r th l zy og
Th qui k rown ox jump ov r th l zy og
Th qui k rown ox jump ov r th l zy o
>>> a = [3, 4, 5]
>>> b = [6, 7, 8]
>>>
>>> for i, x, y in enumerate(zip(a, b)): print(i, x, y)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 3, got 2)
Knapsack Problem
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
Wikipedia for more information
For example you can be...
I'm sure somewhere in Windows there was a super-hidden shortcut for typing special characters, including arrows. Without alt+num. I once found it and used, but forgot what shortcut it was and I can't find anything on it
Go into Control Panel -> Regional Settings, on the languages tab, enable support for East Asian languages. This takes 230 MB of disk space and a restart.
Go back into Control Panel -> Regional Settings, on the languages tab, press the Details button.
Add Chinese (Taiwan) (Others would probably work too) and choose Chinese (Traditional) - Unicode.
You will now have an extra do-hickey in the taskbar showing which language you're in.
Press LeftAlt Shift to switch into the IME (taskbar shows CH).
Type the hex digits of the Unicode character. As soon as you type the last one, it is sent to the a…
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
Wikipedia for more information
For example you can be given a max weigh...
Inspired by this comment...
Thanks to users Step Hen, Wheat-Wizard, and Dennis for helping my solidify the specification of this challenge before posting it!
This is the Cops' thread. For the Robbers' thread, go here
In this challenge, you are tasked with running some code that makes it so t...
Due to technical limitations of Stack Exchange, the title is rendered incorrectly. The correct title for this challenge is
Make a
Word Icicle!
Word Icicle
Word cicle
ord cicle
ord icle
ord i le
ord i l
or i l
or l
or
r
Today's challenge is to mak...
TC CNR
title WIP
Cops:
Create a language that is Turing complete and create a proof. Give the language specs in an answer and keep the proof private.
Rules:
You do NOT need to create an interpreter just a spec.
Language must me Turing complete, any not TC languages will be removed (faulty p...
@Christopher Please don't do that for old proposals. It clutters the first page with an answer nobody cares about anymore, instead of staying hidden on page 10 where it will bother nobody. — Dennis ♦2 mins ago
What does that mean? I didn't edit any old proposals or suggest that someone did.
If you remove a post but didn't post it you can replace the text body with [](lots of text here to reach the min chars) to make it much smaller when removed — Christopher27 mins ago
@Christopher Please don't do that for old proposals. It clutters the first page with an answer nobody cares about anymore, instead of staying hidden on page 10 where it will bother nobody. — Dennis ♦5 mins ago
what Dennis is saying is that if it's near the top, do that, but if it's far down, don't, because nobody goes there anyway and it's worse to shorten it and bump it to the top
Use Splat (*) to pass a bunch of single character strings into a function
For example:
a.replace("a","b")
a.replace(*"ab") -2 bytes
some_function("a","b","c")
some_function(*"abc") -5 bytes
In fact, if you have n single-character strings, you will save 3(n - 1) - 1 or 3n - 4 bytes b...
CMC: Given a string to output and a list of forbidden characters, output a program that outputs the string when run, but doesn't contain any of the forbidden characters.
I recently had a look through the "new" tags and found that most of them apply to 1 or 2 questions, and aren't really necessary. Can we remove these obsolete tags? For reference, the tags I'm referring to are:
Mathematics, which has been proposed as a synonym of math
Circuit golf, which current...