All Questions

6
votes
2answers
301 views

Check if all vowels exist in pairs of strings [closed]

Your program should find the number of string pairs (pairs of 2) that contain all vowels (a e i o u), when given an integer N and ...
8
votes
21answers
2k views

Compare four integers, return word based on maximum

This function should take four integer inputs (a,b,c,d) ...
1
vote
1answer
171 views

(bit)Wise Images [closed]

Given a truth table and two images, use the truth table as a bitwise operation to the two images. For example with the truth table: 1 0 1 0 0 0 1 0 (Note that ...
15
votes
16answers
601 views

Compound Interest… with Wizard Money

Gringotts isn't just a vault, but a reputable financial institution and wizards need loans too. Since you don't want to be screwed over by the Gringotts goblins, you decided it would be a good idea to ...
9
votes
13answers
577 views

Arrays Start at \$\pi\$

Your task is to take an array of numbers and a real number and return the value at that point in the array. Arrays start at \$\pi\$ and are counted in \$\pi\$ intervals. Thing is, we're actually going ...
-2
votes
5answers
251 views

45 degree quine [closed]

A very simple golf this time, but should be fun to do. Challenge Output your code, but rotated 45 (or -45) degrees. E.g: lorem ipsum dolor sit amet becomes <...
2
votes
5answers
227 views

Average Idle-Dice Rolling

So I ran into this progressive/idle game cleverly called Idle Dice. Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk. ...
13
votes
6answers
298 views

Unique Brick Tilings Within A Rectangle

I was browsing Stackoverflow and saw this question about tiling an MxN rectangle, and I thought it would be great for golfing. Here is the task. Given the dimension M and N, write a program that ...
12
votes
18answers
899 views

Jumping Numbers

A jumping number is defined as a positive number n which all pairs of consecutive decimal digits differ by 1. Also, all single digit numbers are considered jumping numbers. eg. 3, 45676, 212 are ...
10
votes
1answer
222 views

Implement MENACE

Background MENACE (Machine Educable Noughts And Crosses Engine) is a rudimentary shallow machine learning algorithm for the game Noughts and Crosses, created by British computer scientist Donald ...
33
votes
5answers
8k views

Historical difference between `/` and `÷` in mathematical expressions

Introduction: Inspired by a discussion that is already going on for many years regarding the expression \$6÷2(1+2)\$. With the expression \$6÷2(1+2)\$, mathematicians will quickly see that ...
6
votes
2answers
278 views

Swapless distances

Suppose you have a string \$s_0\$ and someone else has a hidden string \$s_1\$. You don't know what \$s_1\$ is but they tell you that they can get from your string, \$s_0\$, to their string by making ...
81
votes
63answers
21k views

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Hold up..... this isn't trolling. Background These days on YouTube, comment sections are littered with such patterns: ...
69
votes
37answers
12k views

Am I a Rude Number?

For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, ...
9
votes
10answers
394 views

Generate a Baseball Pitch String

Goal Write a program or function that takes a positive integer n and randomly generate a legal series of pitches (a Pitch string) of length ...
22
votes
17answers
3k views

Play Zip, Zap, Zop

There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the ...
7
votes
7answers
507 views

Check type of an integer

You will receive an integer less than 2000000000 and bigger than -2000000000 and you have to test what type(s) of number this is out of: ...
4
votes
9answers
264 views

Floating over the integers

As you may know, the typical binary floating point numbers in a computer language are quite different than the typical integer numbers in a computer language. Floating point numbers can represent a ...
20
votes
15answers
2k views

Square Root Distance from Integers

Given a decimal number k, find the smallest integer n such that the square root of n is ...
4
votes
2answers
409 views

A nasty little memory leak

Below Python code generates memory leak. Challenge: Fix the memory leak with minimal changes to the code as measured by Levenshtein distance to the original code. You may only change the code before ...
83
votes
31answers
15k views

Eww, those bytes are gross

Write a program or function that, when given a string, filters out as many distinct bytes as it can and returns the cleaned string. However, since your program hates them, none of these bytes can be ...
20
votes
44answers
2k views

Count repetitions of an array

You will receive an array and must return the number of integers that occur more than once. [234, 2, 12, 234, 5, 10, 1000, 2, 99, 234] This will return 2, since ...
14
votes
2answers
528 views

Error-detecting Self-repairing Program

Your task is to create a program where if any one character is deleted, it will detect which character was deleted and then re-insert the deleted character in its own source file. For instance, if ...
10
votes
10answers
540 views

Fizzbuzz in any base

Challenge Input: An integer \$b\$ between 2 and 62 (inclusive). Output: Count from \$1\$ to the equivalent of \$5000_{10}\$ in base \$b\$, using any reasonable representation for the digits. ...
62
votes
19answers
7k views

Crack the bank account's password!

Introduction In order to prevent keyloggers from stealing a user's password, a certain bank account system has implemented the following security measure: only certain digits are prompted to be ...
-3
votes
2answers
221 views

Invert your code [closed]

Challenge Return the full contents of your program, but inverted. How do your invert something? Well, Letters: Take the position of the letter in the alphabet, subtract from 26, and use the letter ...
8
votes
2answers
308 views

Can this container hold this much liquid?

Can this container hold this much liquid? Challenge Synopsis As you most likely know, liquids have an indefinite shape and a definite volume. As such, they always take the shape of their container. ...
25
votes
8answers
2k views

Exploding Numbers

sandbox (deleted) Lets define a matrix of 9s as: $$ N = \begin{bmatrix} 9&9&9\\9&9&9\\9&9&9 \end{bmatrix} $$ Lets define an exploding number as a number at position \$(x,y)\$...
22
votes
13answers
2k views

Build ASCII Podiums

In sporting competitions, it often happens that winners are presented on podiums, with the first-place person on the highest in the middle, the second-place person on the middle height to the left, ...
0
votes
1answer
176 views

Python code to produce C++14 hex integer literal with ticks

tl;dr? See bottom for The Competition Integer literals While programming, the 64-bit hexadecimal literal 0x123456789abcdefL is difficult to gauge the size of. I ...
17
votes
4answers
1k views

What have we got?

Inspired by, and in memory of, our beloved genius, R.I.P. He invented and implemented dfns — his magnum opus and the subject of the challenge. For the interested: latest full dfns documentation and ...
10
votes
9answers
504 views

Left Center Right (LCR) code golf

At a party, I was introduced to the game LCR. Now it's not a great game as there's no skill but only random chance. But it got me thinking, I could code this, and I made a quick program in R to model ...
17
votes
10answers
523 views

2-Dimensional Bubble Sort

Sorting makes no sense for a 2-dimensional array... or does it? Your task is to take an input grid and apply a bubble-sort-like algorithm to it until all values in the grid are non-decreasing from ...
15
votes
9answers
908 views

Finding Gaps in Date Ranges

Given a list of date ranges r as input, output or return any ranges not found in r. For the sake of this example, input will be ...
23
votes
14answers
854 views

Arbitrary Interval Ruler

Make a program that takes a length and list of intervals and outputs a ruler of that length with longer ticks for each interval using the line drawing characters ...
64
votes
56answers
14k views

Sing Baby Shark

"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - ...
26
votes
11answers
936 views

How fast can I say your program?

I recently decided to download some dictation software, in order to help with my writing. However, it doesn't work very well when I'm coding, since I have to change from saying words to symbols and ...
5
votes
3answers
268 views

Return Spiral Indexes!

Spirals are cool , so are numbers, and number spirals are even cooler. But what if I want a specific number, in a specific place using xy coordinates... Challenge Using an infinite spiral moving ...
10
votes
4answers
390 views

Cell phone Charge

Challenge Taken with permission from my University Code Challenge Contest The dependence we have on mobile phones makes us charge them every night up to the maximum level of the battery, so we do not ...
11
votes
9answers
382 views

The Great Pyramid of Quine

The task is a rather simple quine challenge with a twist, you must output your source code in the shape of a pyramid. The shape of a pyramid is defined below: ...
19
votes
25answers
2k views

The Highest Dice

Challenge: Here we have the first 100 items of a sequence: ...
25
votes
4answers
570 views

How lit is this room? 🔥 pt. 1

Related to this question. A room is defined to be a (not necessarily convex) non-intersecting polygon, expressed as an ordered list of 2-dimensional coordinates. A sufficiently bright lightbulb is ...
21
votes
3answers
1k views

Meta-bowling Golf

Your task is to create the shortest program (A) that outputs another program (B) with the most unique bytes, which in turn outputs the original program (A). Essentially, you are golfing one half of a ...
13
votes
5answers
532 views

Passwords Strong Against Bishops

Not to be confused with Password Bishop Goodness! Given a string, answer (truthy/falsy or two consistent values) if it constitutes a password which is strong against bishops. A password is strong ...
24
votes
3answers
526 views

Drawing a tree from an array

Given a possibly nested, non-empty array of single-digit positive integers (not guaranteed unique), output the ASCII-art representation as a tree, using the box-drawing characters ...
25
votes
56answers
4k views

The 465 Arrangement

Here's the challenge. Write some code to output all the integers in a range. Sounds easy, but here's the tricky part. It will start with the lowest number, then the highest. Then the lowest number ...
10
votes
24answers
2k views

Password Bishop Goodness

Derived from this, now deleted, post. Given a string, answer (truthy/falsy or two consistent values) if it constitutes a good Bishop password, which is when all the following conditions are met: it ...
-4
votes
2answers
228 views

Print “beep boop bop” using complicated methods [duplicate]

This challenge is pretty simple: you need to alert / print / show to the user the text "beep boop bop" (or "beep\nboop\nbop", with newlines), but it needs to be obfuscated. (where you couldn't see ...
16
votes
7answers
2k views

Write the longest period iterating quine bounded by 500 bytes

Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes. That is, if you repeat the following steps: Start with your ...
23
votes
17answers
4k views

The real treasure was the numbers we made along the way

Your task is to write a program, function or snippet (yes, snippets are allowed) that simply outputs an integer. However, you must be able to separate your submission into prefixes that also produce ...

15 30 50 per page