# All Questions

24 views

### The unique multiplication spiral

This one is inspired by Calvin's Hobbies recent multiplication table challenge. Write a function or program that takes an integer N as input and prints or returns a N-by-N unique multiplication ...
44 views

### Make a day of the week game [duplicate]

There have been many day of the week challenges on this site. This is just one example. This challenge is to make a game, where you randomly select a valid date with the format YYYYMMDD, with a year ...
120 views

### Sort the unique numbers in a multiplication table

Pretty simple challenge today: Write a program or function that takes in a positive integer N and prints or returns a sorted list of the unique numbers that appear in the multiplication table whose ...
45 views

A man has two devices. A time machine - He can control this machine by thinking. It allows him to travel from any point in time to another point in time in the past or future (or even the present ...
25 views

### Why try {} catch{} dosent work in c#? [on hold]

I have a try{} catch{} block in my program in visual studio. in try{} block i have a code to connect DB and when run that program return error. Whatever in this situation program must execute catch{} ...
63 views

### Implement LaTeX accent macros

Introduction The LaTeX typesetting system uses macros for defining accents. For example, the letter ê is produced by \hat{e}. In this challenge, your task is to implement an ASCII version of this ...
310 views

### Output the Current Time

Challenge You must output the current time continuously (until cancelled by an interrupt), once every second, by any of the following means: It must be in 24-hour or AM/PM format. If it is the ...
133 views

### Check my program! [on hold]

Challenge Make an error-checker in the least amount of possible bytes! If you received an HTML program as a string through standard input, your program will be able to find all the errors and return ...
38 views

### HQ9+ implementation [duplicate]

Write the shortest possible implementation of HQ9+ in a language of your choosing. Bonus points if you can do it in HQ9+ itself.
167 views

### Title Keywords in Context

This challenge is based on a problem described in D. Parnas, On the criteria to be used in decomposing systems into modules, and elaborated upon in J. Morris, Real Programming in Functional Languages. ...
304 views

### Golf yourself a beer

It's friday! Which means it's time for beer! Sadly though, today we will be golfing beer instead of drinking it. :( Challenge Output a beer and drink it. The amount of sips you take changes your ...
58 views

### why the Thanksgiving day is “ lambda x:”11/“+28-(x-2+x/4-x/100+x/400)%7 ” [on hold]

28-(x-2+x/4-x/100+x/400)%7 ??? what's the meaning? When is Thanksgiving?
34 views

### Java Code Error [on hold]

Two Issues Im Having @Override public boolean onCreateOptionsMenu(Menu menu) this^^^^^^ is giving me an error saying Method does not override method from its superclass return ...
857 views

### Count the divisors of a number

Introduction This is a very simple challenge: simply count the divisors of a number. We've had a similar but more complicated challenge before, but I'm intending this one to be entry-level. The ...
274 views

One aspect of password strength testing is runs of adjacent letters on the keyboard. In this challenge, a program must be created that returns true if a string contains any runs of adjacent letters. ...
49 views

### Which is the closest train station? [duplicate]

Goal Write a full program that generates a map showing the local train stations and which train station is the closest to every point on the map. Requirements Input A set of tuples. The first is ...
856 views

### What is that angle?

The goal of this challenge is to determine the angle of a line in a image. Rules on the image: The image background will be white (#FFFFFF) The stroke of the line will be black (#000000) The line ...
877 views

You should write 3 programs and/or functions in one language. All of these programs should solve the same task but they all should give different (but valid) outputs. (I.e. for every pair of programs ...
237 views

### Thanksgiving Turkey

(Hopefully it's still Thanksgiving for you) You got a turkey for your thanksgiving dinner but you don't know how to evenly distribute it. The problem is, some people eat more than others, so you need ...
3k views

### Legen… wait for it…

dary! In events entirely unrelated to what will hopefully happen to me in the next couple of days, I task you to write code that does the following: Print Legen... wait for it... immediately, ...
561 views

### Chemical sentences! Decrypting [duplicate]

Background You are sitting in chemistry class and your friend keep sending you these strange letters. It is your job to decrypt the messages into words. This is the inverse of this challenge. The ...
79 views

### Chemical sentences! Encrypting [duplicate]

Background You are bored in class, and having exhausted all the possible things to write on a standard calculator (Like 8008135) you turn to the periodic table. You want to figure out if you can ...
35 views

### Find a one liner in vb for case function when case increments every 5 natural numbers [on hold]

Having a number greater or equal to 10 and having a max case when is equal to 70 like: Select Case number Case 10 To 14 Return 10 Case 15 To 19 Return 14 Case 20 To 24 ...
1k views
+100

### Count sums of two squares

Given a non-negative number n, output the number of ways to express n as the sum of two squares of integers n == a^2 + b^2 (OEIS A004018). Note that a and b can be positive, negative, or zero, and ...
174 views

### Black Friday Queue Managment

Introduction You are the manager of the electronics department in a major retail store and the biggest sales day of the year is this Friday. To help manage the crowds, your store is implementing a ...
71 views

### Most intricate way to produce the Fibonacci Sequence [on hold]

The aim is to use as many characters as possible to print the Fibonacci Sequence You may use and language you wish Every line in the code must be essential to it's function. Try to use as many ...
3k views

### When is Thanksgiving?

Background Some holidays have fixed, easy-to-remember dates, like Oct 31, Dec 25, etc. Some, however, want to be troublesome. They're specified as things like "the first Monday in September" or "the ...
223 views

### Sprocket Science: Animating a Chain Drive System

The goal of this challenge is to produce an animation of a chain drive system, comprised of a set of sprocket gears connected together by a chain. General Requirements Your program will be given a ...
586 views

### Make the PPCG Logo

Come November 1, Programming Puzzles and Code Golf will graduate, so in the next 11 months, we'll want to save some memories from when we were ungraduated. Write a program that produces the PPCG ...
329 views

### Find maximal matching in divisibility relation

You are given a set of positive integers. You must arrange them into pairs such that: Each pair contains 2 numbers, one of which is a multiple of another. For example, 8 is a multiple of 4, and 9 is ...
179 views

### Loop Detection - not that kind!

The goal of this challenge is to find the direction and area enclosed by a loop. Input: A rectangular grid consisting entirely of these characters: ^v<> (Optionally, you may also be given the ...
210 views

### List numbers within given ranges [duplicate]

Goal: Your goal is to print out numbers within a given range (Also including given values). Input Format: The input will look like: (int-int, int-int, ...) ... meaning the user can add as many ...
33 views

### Exp function with only addition? [on hold]

I trying to create a Haskell function: exp :: Int -> Int -> Int wich calculate x^n only en terms of sums... How can i start? I'm new in this programming paradigm.
939 views

### Make a Math Competition Grader

I enjoy participating in math competitions run by Mu Alpha Theta, a mathematics honor society in the United States. At competitions, I take a 30-question multiple choice test. There are five choices ...
76 views

### Quiz Program Compiler

A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that. Your task Write a program/func/etc. ...
126 views

### Quine Pride Parade! [on hold]

These days, I watched on TV a Gay Pride parade; at the time, I was thinking about quines and how they're a bit queer, outputting themselves (out of the closet?) and, well, why not combine both things ...
4k views

### Lever Simulator 2015

Why a Simulator? Kids these days don't have the time nor the ambition to actually go and stack boxes on the see-saw or play around with balancing physical objects. This leaves lots of room in the ...
79 views

### How many typos? [duplicate]

A typo is said to have occurred if: A character is missing. A character is extra. A character is replaced with another wrong character. For the purpose of this challenge, only lowercase characters ...
573 views

### Josephus problem with three inputs

There's a question on this site that is similar to this question, but I have added a twist. You have three inputs, the number of people in the circle n, the k-th person counted out at each step, and ...
62 views

### Longest valid palindrome command in any language [on hold]

Write a valid command (no errors) that is the longest palindrome. E.g. if you can execute "echo ohce" in a language without error, that would be valid.
215 views

### Generate Toothpick Sequence

What is Toothpick Sequence? According to Wikipedia In geometry, the toothpick sequence is a sequence of 2-dimensional patterns which can be formed by repeatedly adding line segments ...
85 views

### Literally Mirror Your Sourcecode! [on hold]

Task Your program should take input. If the input is falsy, print the source code. If the input is truthy, print the mirrored source code. What is mirrored in my opinion (That is used in this ...
3k views

### Output the qwerty keyboard

Given a character, output (to the screen) the entire qwerty keyboard layout (with spaces and newlines) that follows the character. The examples make it clear. Input 1 f Output 1 g h j k l z x c v ...
387 views
+50

### Happy Fibonacci Day!

Background Today (or Yesterday)'s is (or was) 11/23 or Fibonacci day! What better way to celebrate than to make a fibonacci cake? Examples 3 ii i_i_ii_i_i 8 ii ...
108 views

### Negate a condition if a bool is FALSE [on hold]

Let's say I have a condition expression x and that I want to check if it is TRUE or FALSE depending on the value of a boolean y: y ? x : !x Is there a way to express it without repeating x ...
2k views

### Find the center

Given a string of ASCII characters, output the character that is in the middle. If there is no middle character (when the string has an even length), output the ASCII character whose ordinal is the ...
115 views

### Define map in the fewest tokens [on hold]

map is a very basic yet important function in functional programming. All FP programming languages have it built-in but it is always fun to see how shortly you can define it yourself. This will be ...
188 views

### Ducttape the Ducttape

Your boss has found out that quite a bunch of his employees (including you) like to steal code from others. He ordered you to write him a program that he can use to find people who steal code from ...