0
votes
0answers
14 views

Appeal to Probability expressed in Gnu-APL [on hold]

Requirements: Expression must be executable in Gnu APL Expression must not obtain, ie the answer must be 0 The specific form of the "Appeal to Probability" that I am speaking of (There is more, ...
3
votes
2answers
22 views

Kakuro Combinations

Kakuro Combinations Because I can't do mental arithmetic, I often struggle with the Kakuro Puzzle, which requires the victim to repeatedly work out which distinct numbers in the range 1 to 9 ...
2
votes
0answers
39 views

Magic back yards optimization puzzle

My back yard forms a rectangular grid of squares except some of the squares are missing as they are covered by pipes or a small tree. The layout is as follows. A 'x' indicates a square that is free ...
0
votes
2answers
76 views

Collatz Graph Plotting

Write a program that outputs a graph of the collatz sequence any way you want (ASCII Image Video etc). You have to implement it that way that you can adjust the size of the graph by either the maximum ...
6
votes
12answers
299 views

Rank a list of scores with “skips”

Given a list of scores (non-negative integers) pre-sorted from greatest to least: [ 10, 10, 6, 6, 4, 0] Assign each score an integer rank, beginning with 1 and ascending, such that equal scores ...
10
votes
18answers
1k views

The Real Slim Shady

Echo the following in as few bytes as possible: I'm Slim Shady. Yes, I'm the real Shady. All you other Slim Shadys are just imitating. So, won't the real Slim Shady please stand up? Please stand up. ...
4
votes
0answers
198 views

Trap the mouse!

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen. ...
0
votes
2answers
149 views

Modular exponentiation using only addition and subtraction

The challenge In the least number of source code characters, in a language of your choosing, devise a function which raises base a to power b, modulo m, using purely integer arithmetic, where a, b, ...
1
vote
5answers
230 views

Implement atoi function [duplicate]

You already know that the atoi function of stdlib.h converts a string to an integer. atoi (copied from here) int atoi (const char * str); Convert string to integer Parses the C-string ...
13
votes
2answers
410 views

Find the shortest bracket numbers

Bracket numbers provide a simple way to express large integers using only left bracket, space, and right bracket ([ ]). A bracket number is defined as a string of one or more pairs of matching ...
2
votes
0answers
76 views

2nd byte bias of RC4

Short version RC4, designed in 1987, is one of the most famous stream ciphers. This question asks you to practically demonstrate its 2nd byte bias (for a theoretical proof, see section 3.2 of this ...
14
votes
0answers
357 views

Don't. Even. Blink

Your life could depend on this. Don't blink. Don't even blink. Blink and you're dead. They are fast. Faster than you can believe. Don't turn your back, don't look away, and don't blink! Good ...
5
votes
3answers
401 views

Create a FizzBuzz compiler

Welcome to the world of compiler golf. Your task is to write a program that generates another program to play a variant of FizzBuzz on spec. Your compiler Write a compiler that generates variants of ...
-6
votes
0answers
78 views

Steganography challange [on hold]

I found this challange and I have some problems solving it. I opened the first picture with an editor and I found the key 123456-cops-like and in the second file I found details about the encryption ...
-1
votes
2answers
131 views

Find prime which is generating longest primes sequence using p(n+1)=(p(n)^2+1)/2

Consider following recurrence relation: p[n + 1] = (p[n]^2 + 1) / 2 If p[1], p[2], ..., p[k] are primes and p[k+1] is not, then k is length of sequence starting with p[1]. For example, if p[1] = 3, ...
4
votes
3answers
272 views

When is my piversary?

Since I want to celebrate this definitely not nerdy event, your job is to calculate the piversary (pi-anniversary) of a given date. Input Your code has to have a possibilty to input a date in the ...
24
votes
9answers
3k views

Find the largest prime whose length, sum and product is prime

The number 113 is the first prime whose length 3 is prime, digital sum 5 = 1 + 1 + 3 is prime, and digital product 3 = 1 * 1 * 3 is prime. A prime that has these 3 properties will be called supremely ...
-4
votes
0answers
109 views

Take down the competition! [on hold]

The Story... After one short year, you have been promoted to senior executive vice president manager of programmers (now that looks good on a resume) at the esteemed company X productions. You ...
11
votes
7answers
725 views

Spell out numbers in French

There was a challenge to convert a number to its numeral in English, but that was too straightforward. Given a number 0–100, your task is to output the corresponding numeral in French. The French ...
20
votes
21answers
3k views

When was the last time the date was divisible by n?

A date can be represented by an unsigned integer as such: YYYYMMDD. What you need to do, is write the shortest program or function that figures out the most recent date whose number was divisible by a ...
2
votes
2answers
311 views

Find the closest pair of integers which will be neighbors when sorting an array

An integer V lies strictly between integers U and W if U < V < W or if U > V > W. A non-empty zero-indexed array A consisting of N integers is given. A pair of indices (P, Q), where 0 <= P ...
27
votes
10answers
4k views

Make a code square with your favorite word

Pick your favorite 6 letter common English word that has no repeated letters, such as wombat. Write a program in an N×N grid of characters without comments such that each row and column contains all ...
22
votes
8answers
2k views

3D: Discrete Dogfighting Duel

UPDATE: updateCoolDown() separated from simulateMove() UPDATE: non-Java entry wrapper, written by Sparr, available for testing, see comments UPDATE Zove Games Has written an awesome 3D visualizer ...
14
votes
4answers
926 views

Forest - A Simulated Ecosystem

NOTE This problem was taken from this reddit thread (spoiler alert!), and I have adjusted it to make it fit with this site's format. All credit goes to reddit user "Coder_d00d". In this problem, we ...
0
votes
0answers
30 views

Clickable Tooltip VB.net [migrated]

I am creating a textbox control, which have some text, i need to compare that text with some variable text and i need to show it as a popup or tooltip nearby the textbox control My VB.net code ...
42
votes
12answers
3k views

Write the whole of the holed using the unholed

The ASCII characters from decimal code 33 to 126 are: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} Notice that in most fonts, 25 of these ...
30
votes
22answers
5k views

Draw the Sawtooth Alphabet

A simple one today. Write the shortest program that draws a "sawtooth alphabet" given a positive integer for the height. You must write the name of your programming language when you come to the ...
-5
votes
0answers
102 views

Nested for loop puzzle [on hold]

I am a PHP beginner and I interested in the loop exercise and saw a funny questions as below shown. -Create a script to construct the following pattern, using a nested for loop. -For the ...
10
votes
1answer
511 views

How much time will I need to unlock my Android phone?

Scenario I am using pattern matching lockscreen and I sadly forgot my pattern. I would like to know how much time I will need to unlock it. Here are the specifications of Google's lock screen, that ...
-2
votes
0answers
79 views

Evenly Distribute students into rooms based on student study subjects and room limitations [closed]

The problem is that I need an algorithm (preferably in PHP) to solve the following problem. I've looked at a lot of "bucket" algorithms but none seems to cover what I am after Students need to be ...
17
votes
2answers
548 views

Where are the runs in this infinite string? (CCCCCC Found!)

Starting with the string ABC, consider the result of repeatedly appending the last half of itself to itself (using the larger half if the length is odd). We get the progression: ABC ABCBC ABCBCCBC ...
6
votes
1answer
379 views

'Number' Crunching Benchmark

I just want to do some benchmarking of different programming languages. So here is a tip: You can use as many characters as you want. In the end there is only the time your program needed. So, here ...
-4
votes
0answers
102 views

*any* fractal drawing [closed]

Write a code that draws any fractal (no ASCII-art). Be sure to document code, does't have to be in the actual code but please explain your code! Also try to have the smallest big-oh you can get. Don't ...
-1
votes
0answers
120 views

Make a 'flashy' number squaring program [closed]

A flashy program is defined here as a program that does something simple in the most overblown way. Your task is to write a program that squares a number in a 'flashy' way: first, display a prompt ...
10
votes
23answers
2k views

Integer square root of integer

Problem: In your choice of language, write the shortest function that returns the floor of the square root of an unsigned 64-bit integer. Test cases: Your function must work correctly for all ...
3
votes
9answers
424 views

Base-2 integer logarithm of 64-bit unsigned integer

Problem: In your choice of language, write the shortest function that returns the floor of the base-2 logarithm of an unsigned 64-bit integer, or –1 if passed a 0. (Note: This means the return type ...
6
votes
1answer
240 views

The Mouse's Tale

Write a program that outputs Lewis Carroll's poem The Mouse's Tale from Alice in Wonderland, drawn in its distinctive tail-like shape. Plain text of the poem: Fury said to a mouse, That he met ...
7
votes
11answers
528 views

Convert numbers to symbols without string or char literals

Read infinitely from stdin, and convert every number to the corresponding symbol on a US qwerty keyboard. No string or character literals anywhere are permitted. E.g. if the input is 117758326, the ...
7
votes
1answer
211 views

How many characters per character?

At http://shakespeare.mit.edu/ you can find the full text of each of Shakespeare's plays on one page (e.g. Hamlet). Write a script that takes in the url of a play from stdin, such as ...
15
votes
24answers
988 views

Convert a string of binary characters to the ASCII equivalents

Take a string of binary characters separated by a space, and convert it to an ASCII string. For example... 1001000 1100101 1101100 1101100 1101111 100000 1010111 1101111 1110010 1101100 1100100 ...
73
votes
70answers
10k views

The Rock, Paper, Scissors, Lizard, Spock Tournament of Epicness

Most Recent Leaderboard @ 2014-08-01 08:30 | Pos # | Author | Name | Language | Score | Win | Draw | Loss | Avg. Dec. Time | ...
8
votes
4answers
525 views

Weaving in ASCII

Imagine a rectangular grid of | characters represents the taut strings on a loom (the warp) that other threads (the weft), which we will represent as -, can be woven around. Here is the unwoven warp ...
-2
votes
0answers
77 views

How to be sure that a target goal in a match 3 game level will not be impossible? [closed]

This is clearly not a coding problem but the logical one. I am starting to learn how to make a match 3 game. but there is a question rising in my mind. when i will set goal to complete the level, how ...
4
votes
4answers
529 views

Efficient Way to solve this puzzle

A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic ...
4
votes
6answers
607 views

Mr. Moneybag's Money Piles

Mr. Moneybags is a very rich man. He has an assistant Mr. Perfect, who one day, got very mad, and shredded some of Mr. Moneybag’s $100 bills! Mr. Moneybags decided to punish Mr. Perfect. Mr. ...
15
votes
4answers
553 views

Three-pointer! But what kind?

From http://en.wikipedia.org/wiki/Triangle: Write a program that takes three 2d coordinate tuples (Cartesian), and classifies what shape these three points describe. In almost all cases these ...
9
votes
2answers
357 views

place vials in your centrifuge

This question originates in this reddit thread by reddit user taho_teg but it is expanded to a more general 'puzzle'. You have a centrifuge with 24 holes for the vials uniformly distributed in a ...
2
votes
1answer
241 views

Recursive Mathematical Puzzle from a high school contest

The problem appeared on the 2013 SJCNY High School Programming Contest. It was the last question in the set of problems and no team produced a correct answer during the 2.5 hours they had to work on ...
7
votes
8answers
850 views
+150

Write an IBAN validator

Write a program (the body of the function is enough) that accepts a string of alphanumeric characters and validates it according to ISO 13616:2007. The algorithm for validation is (source: wikipedia ...
1
vote
4answers
96 views

Generate the group table for Z_n

Groups are a widely used structure in Mathematics, and have applications in Computer Science. This code challenge is about the fewest # of characters to create a group table for the additive group ...

15 30 50 per page