0
votes
0answers
24 views

Build a program that creates a minimal one-ohm resistor diagram for a given resistance

You are a contractor for a company who designs electrical circuits for the various products they make. One day, the company accidentally gets a huge shipment of one-ohm resistors and absolutely ...
4
votes
0answers
51 views

Inverse CIDR whitelist

The task The task is to write a program that turns a list of IPv6 addresses into a shortest possible list of CIDR masks, such that everything but those IPs is matched. CIDR masks A CIDR mask ...
2
votes
4answers
95 views

Longest Common Subsequence of Two Strings containing a particular Substring

A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. Given three strings A, B and C (note the order) ...
-1
votes
0answers
19 views

Program to partition an integer array into two arrays which has the same sum [duplicate]

Write a program to partition an integer array into two arrays which has the same sum. Input: 1 2 3 Output:1 2 and 3
1
vote
5answers
152 views

Let's learn geometry

Today our lesson is about rectangles and triangles. you will be given as an input an n x n grid that is based on two characters # and * you have to classify it into : triangle or rectangle. where # ...
2
votes
4answers
212 views

Create a seven-color rainbow with animation

Goal Use any graphics library or environment that can use colours and animation to create a rainbow. Rules The rings should emerge one by one in some kind of animation or succession The rainbow ...
-1
votes
1answer
72 views

Shortest way to generate UUID's version 3,4 and 5 in php

I have this function to generate UUID's: function uuid($v=4,$d=null,$s=false)//$v-> version|$data-> data for version 3 and 5|$s-> add salt and pepper { switch($v.($x='')) { ...
1
vote
1answer
71 views

Computer Generated Olympic Theme Song

Try to regenerate the olympic theme song, "Bugler's Dream" using the programming language of your choice. The language/platform used must be able to emit the physical sound. Only playing the main ...
6
votes
2answers
115 views

Create a sophisticated livelock

The point of the puzzle is to learn about livelocks: Create a multi-threaded (or a multi-process) program, whose threads (processes) indefinitely try to wait for each other and never finish. Unlike a ...
4
votes
1answer
86 views

Match strings whose length is isolated prime

Isolated prime definition from Wikipedia: An isolated prime is a prime number p such that neither p − 2 nor p + 2 is prime. In other words, p is not part of a twin prime pair. For example, 23 is ...
2
votes
1answer
102 views

C code indenter

Situation: You are a high school teacher, teaching your computing class how to write C programs. However, since it is just the beginning of the term, you haven't taught them about the importance of ...
0
votes
3answers
87 views

Output in the Correct Order

Ok lets say we get a input the following csv file (all entries are quoted strings) ID, Before, After, Value 1, 3, 5, Cat 2, 5, , Apple 3, 4, ...
5
votes
8answers
333 views

Calculate the super root of a number

In mathematics, tetration is the next hyper operator after exponentiation, and is defined as iterated exponentiation. Addition (a succeeded n times) Multiplication (a added to itself, n times) ...
1
vote
4answers
237 views

Linkin Park Logo [on hold]

Your goal is to draw the Linkin Park Logo It's a popularity contest to see what twist you all will give to it! Rules: No particular rules, you can use "=" or "+" Please add a title with the ...
-4
votes
0answers
131 views

9-hole Minigolf: Math/Logic edition [on hold]

Inspired by 9-hole mini-golf: Text Manipulation Hole 1 | Easy start What digit is most frequent between 1 - 1000(inclusive). Required output: list of digits 0..9 sorted on frequency->digit(Desc) ...
6
votes
7answers
519 views

Print the time in a digital watch [duplicate]

Write a program that prints the current time in a digital watch. Rules: The program must use the local timezone. Time is expressed between 00:00 to 23:59 (with only hours and minutes). The program ...
1
vote
4answers
155 views

tree from string

A string like this one: "a, 4.25, ((true, 5), 3, (false, false, false)), abc" Describes a tree with 13 nodes, 9 of which are leaf nodes. In C# the leaf nodes in this example would be of types ...
24
votes
15answers
1k views

number of answers and comments

Write a software that prints on stdout the number of answers and the number of comments(visible and collapsed of question and answers) of this question/page. Your script must run with this page ...
-1
votes
0answers
35 views

All the Tree's Children [on hold]

There once were a society of little people that lived in a gigantic tree There exists an arraylist of Object. But the arraylist needs to be a tree with the following parameters: Some Objects are not ...
7
votes
9answers
380 views

Unreliable data stream

Your challenge is to golf a program that mimics a data transmission stream. Your program should read input from stdin and output it directly to stdout. To make the problem more interesting, the output ...
-5
votes
0answers
70 views

Write a program using the Win32 API that draws an image on a window pixel-by-pixel, and allow movement of each pixel by corresponding keypresses [on hold]

This challenge calls out for one to draw a distinguishable image pixel-by-pixel, and allow a corresponding keypress to displace that pixel. Here are the rules: 1.A minimum of 65 pixels, any color. ...
4
votes
11answers
375 views

Partition of Array [duplicate]

Given an integer array. You have to check whether it is possible to divide the array in two parts such that the sum of elements of one part is equal to the sum of the element of the other part.If it ...
28
votes
25answers
7k views

ASCII art “Hello-World!”

Your goal is to write the shortest program that outputs "Hello-World!" as ASCII art. Rules : It must be human readable, I don't care about it's size (cols/rows) Output must contain only spaces (" ...
22
votes
24answers
3k views

I'm walking around manhattan, how far am I from my hotel?

The unnecessary and convoluted story I am walking around manhattan, block by block and my feet have gotten tired and want to go back home. The traffic is pretty bad, but fortunately I'm very rich ...
3
votes
0answers
175 views

Battleship game

Given the scheme of the fleet of the human player, let the user choose which coordinates attack each turn. The "computer player" will then attack on its turn following the classic rules of battleship. ...
2
votes
6answers
251 views

Rotate simple ASCII art

This is similar to a previous question on this site, but with much simpler rules, so we should get much shorter results (in bytes): Input: ASCII art with only two possible characters: space and ...
-2
votes
2answers
118 views

Is an email is Spam or Ham? [on hold]

Challenge Given an email in plain text format, including headers, decide if the email is either spam or ham, and output SPAM or HAM respectively. The emails will be given below. Your code must be ...
9
votes
27answers
885 views
+50

Shortest Program to Sort a List of numbers into Odd and Even Category

In the New Modern Times, when Charlie Chaplin encounters a computer, he is employed in the sorting Yard, as a validator to determine if the workers are correctly sorting the items. The Items in ...
8
votes
35answers
3k views

Shortest method to implement the Pythagorean Theorem

Who doesn't love the pythagorean theorem a²+b²=c²? Write the shortest method you can in any language that takes in value a and b and prints out "The hypotenuse of this right triangle is " + c. Keep c ...
1
vote
0answers
127 views

Find a way to filter out swear words even if the user has escaped them [on hold]

For this, imagine that the following words are really nasty cuss words: Frag, Smeg, Felgercarb, Blatherskite, Dadgum, Fnord, Smurf, Schmit Now, I need to filter out swear words on my website. ...
5
votes
9answers
319 views

Golf an LZW encoder

Given an alphabet and a string, your job is to create the Lempel–Ziv–Welch compression of the string. Your implementation can either be a function with two parameters and a return value, or a full ...
-2
votes
6answers
111 views

Output the alphabet with the shortest code possible [duplicate]

You have to output the alphabet (upper case) with the shortest code possible. Exact output expected : ABCDEFGHIJKLMNOPQRSTUVWXYZ
5
votes
3answers
214 views

Concert tuning WAV

I used to play the oboe, the instrument that is, for some reason, used to tune the orchestra to A440. Anyways, continuing on with my story, I was bad at it and quit. Write a program that generates a ...
4
votes
3answers
295 views

Darts meets Codegolf

I think everyone is familiar with darts, some people dont understand the scores so for those people here is a usefull link on that. The board A dartboard can be compared to a pie cut in 20 pieces. ...
6
votes
2answers
162 views

Refactor variable names in JavaScript code

Your challenge today is to refactor JavaScript code. You will take three strings as input; a JavaScript string, a old variable name, and the name you want to refactor it to. For example, an input of ...
1
vote
6answers
210 views

Animated sound waveform

Make an animated sound waveform using any programming language your prefer, the squares of the spectrum can be of a single color (no rainbow effect). The animation must be infinite and not a loop ...
38
votes
24answers
7k views

The answer to life the universe and everything

introduction: Deep Thought calculated The answer to life the universe and everything in a period of 7.5 million years, the solution was 42 Write a software in any programming language that takes ...
6
votes
19answers
2k views

shortest code to encrypt a string

Using a language of your choice write a program that takes a string as an input, and returns the string encrypted. Algorithm: You should assume that each character is always encoded in a byte and is ...
6
votes
6answers
232 views

Determine whether a car can get around a route with a limited amount of gas

Using any programming language that supports functions, have the function is_enough(strArr) that take strArr which will be an an array consisting of the following elements: N which will be the ...
-1
votes
0answers
62 views

self execute over ssh

Write a program that executes instances of itself over ssh connections. An example of this functionality in bash is: #!/bin/bash agregateResults (); { while read line; do echo "Program Output: ...
-5
votes
3answers
66 views

Shortest code to reverse a string [duplicate]

The winner will be the one to use the shortest code to reverse this string: Today there was two clouds in the sky, each forming a shape. It may be in any programming language.
0
votes
0answers
84 views

Find the best path in a “match-3” game

Suppose you want to cheat in a "match-3" game. In this "match-3" game: In each turn you can move a gem along a path. For example, you can move a gem right-right-down, as in A. (The gems are ...
-1
votes
0answers
135 views

Create an interactive arbitrary precision calculator [on hold]

Without using libraries, create an arbitrary precision calculator supporting: Addition Subtraction Multiplication Division Proper order of operations, including paranthesis and let it be ...
0
votes
0answers
61 views

The next network boot protocol: simple unified knetwork starting [on hold]

The company you work for is introducing to the market their new 128 bit computer and you have been charged with writing the boot specification. Your boss has informed you that it must be compatible ...
3
votes
3answers
232 views

Interactive Lights Off game

Intro I guess most people are familiar with the game Lights Off, but in case someone isn't, here is a short description: You start with an NxN grid where each cell in the grid is a light. For ...
10
votes
2answers
292 views

QR Codes… and all that Jazz!

This is going to be relatively challenging code-golf challenge. Input: Any URL, must have the protocol attached, e.g. http://codegolf.stackexchange.com (which will be our test case) Output: A ...
-1
votes
0answers
54 views

Code Golf: Number to Text [duplicate]

The input is a non-negative integer (this includes zero!) less than 1024, and the output is a string. For example: Possible Inputs 102 304 225 0 1021 Respective Outputs one hundred two three ...
0
votes
8answers
367 views

Build a numerical library without using any primitive data type

The task is to build a numerical library for working with arbitrarily large integers that supports the following operations: addition subtraction multiplication division modulo operation However, ...
12
votes
6answers
1k views

Down the drain it goes

I once encountered this (mini) game where you had 4 or more vertical pipes that were connected by a number of horizontal pipes and you have to drop a ball or water into the vertical pipes. There are 2 ...
3
votes
11answers
544 views

Counting triangles

You are required to find how many triangles are unique out of given triangles. For each triangle you are given three integers a,b,c , the sides of a triangle. A triangle is said to be unique if there ...

15 30 50 per page