# All Questions

12,434 questions
Filter by
Sorted by
Tagged with
9 views

### A Suitable Mission — The Professor's Revenge

Summer Klerance turned in her term assignment for this challenge. Her professor was miffed (but also amused) when he overheard a disgruntled classmate of Summer's saying she got her answers by ...
390 views

### Make an array of 128 bit integers

Given an input value $n$, construct an array of $n$ random 128 bit (unsigned) integers. The integers should be uniformly random. Your code can use any in built random number generation function ...
263 views

### Index and return 3 characters

The challenge is simple: Read the first 3 letters from a system input¹ and convert them to numbers (A-1, B-2, C-3...Z-26)². Print each of those numbers in the order ...
189 views

### Are you a probabilist or a physicist?

Hermite polynomials refer to two sequences of polynomials: The "probabilist's Hermite polynomials", given by $${He}_n(x) = (-1)^n e ^ \frac {x^2} 2 \frac {d^n} {dx^n} e ^ {-\frac {x^2} 2}$$ ...
67 views

### Generate procedural images at compile time with C++ templates [closed]

The C++ template system is Turing-complete at compile time. Your challenge is to procedurally generate an image using the template system. You must write a template class or function which takes ...
720 views

### What if function application was right-associative?

Background In Haskell and many other functional languages, function application f(x) is simply written as f x. Also, this form ...
2k views

### King of the Hill: Nose Poker - An ogre game for ogres

Nose Poker is an ogre game played by a group of ogres. Each ogre brings a large nose and a small club. On each hand, all the ogres will declare how many times they will poke their nose with the club. ...
629 views

### Sliding Dice in a Dish

We have 3 dice in a square dish. The dish is 8 units wide and tall and each die is 3 units wide and tall. The dice are facing up each with a different number on their top face. ...
1k views

### Third Stirling numbers of the second kind

$\left\{ n \atop k \right\}$ or $S(n, k)$ is a way of referring to the Stirling numbers of the second kind, the number of ways to partition a set of $n$ items into $k$ non-empty subsets. For ...
271 views

### Hexagonal section numbers

Introduction Let's draw some regular hexagons formed by hexagonal tiles, marking the vertices of the tiles with dots. Then we will count the number of dots. ...
2k views

1k views

### Ploughed fields via moduli

Let $R, C$ be positive integers and let $0 < s \leq 1$. Consider the $R \times C$ matrix $\mathbf M$ defined as \begin{equation} M(i,j) = \frac{\mathrm{mod}\,(j, i^s)}{R^s}, \quad i = 1, \...
245 views

### Packing Cuboid Boxes into the Shortest Stretchy Truck

You are a package handler for Big CompanyTM and your job is to load boxes into a truck. These are special, stretchy trucks: their length can be adjusted at will. But stretching trucks are expensive, ...
3k views

### Roll up a D&D character, with options

I'd like to roll up the ability scores for my Dungeons and Dragons character. But I'd also like them to be balanced (and slightly better than average). Typically, a character's stats are created by ...
2k views

### Recursive Z-matrix

Originally from a CMC I proposed for the last BMG event Challenge Given a non-negative integer $n$, create a 2D array of size $2^n × 2^n$ which is generated in the following manner: Divide the ...
185 views

### Chasing the car [closed]

Imagine you are sitting at a park. Suddenly your car gets hijacked and being driven in different directions. Here are the directions, arrows show which direction goes towards where: ...
2k views

### Project Euler 1: Multiples in constant time

The purpose of this challenge is to solve the original first Project Euler problem, but as the title suggests in constant time (with respect to the size of the interval). Find the sum of all the ...
2k views

### Compute the Fibonacci product

Background We've had challenges before on Fibonacci coding and Zeckendorf representation. These representations follow naturally from Zeckendorf's theorem, which states that every positive integer ...
289 views

### Play Thud! (Troll Edition)

Key Links Dwarf question Chat room Game Controller Interface Troll league table ...
276 views

### Play Thud! (Dwarf Edition)

Key links: Troll question Chat room Game Controller Interface Dwarf league table ...
300 views

### Is this a complete Boolean function?

A complete Boolean function is a function such that, an amount of them can be used to express any Boolean function. For example, NAND \\$\left[\begin{matrix}\text{input1}&0&0&1&1\\\text{...
299 views

### Is IMPLY enough for this function? [closed]

Given a boolean function with inputs, check if it's possible to only use IMPLY gate to express it. There's no extra limitation on how you use this gate, and you can use each input for any amount of ...
2k views

### Help Alice fix her text!

When Alice was touch typing on her QWERTY keyboard (Figure 1), she accidentally shifted both of her hands rightwards by one key, so q became ...