All Questions

Filter by
Sorted by
Tagged with
47
votes
8answers
4k views

Who is this chatbot?

Objective: The task is to create a chatbot with whom you can spend your time discussing your deepest thoughts with. Create a chatbot with an AI that learns from your input. Your bot should inspire ...
4
votes
4answers
397 views

Print a specific value in the infinite Walsh matrix

The Walsh matrix is an interesting fractal matrix with the property that every single value in a Walsh matrix has a value of either -1 or 1. Additionally, the size of a Walsh matrix is always a power ...
0
votes
1answer
3k views

Plot gif of 3 dimensional heart in R [closed]

inspired by this blog: http://alstatr.blogspot.co.uk/2014/02/r-animating-2d-and-3d-plots.html I made a 2D gif of a heart with: ...
42
votes
15answers
7k views

It's a rainy day

Context It's Valentines Day. The only one you ever loved left you yesterday for this guy she always found "stupid and uninteresting". On your way home, you've been stuck in traffic, listening ...
34
votes
18answers
3k views

Code Romanization

The challenge is to make any Roman numerals valid code in your chosen language. They should not appear inside of strings or anything similar, but work just like any other tokens, literals such as (...
19
votes
3answers
2k views

Shortest a -> b -> (a -> b) function in Haskell

I got the following question at a test: Write a function f with the following type a -> b -> (a -> b). ...
14
votes
12answers
6k views

3 and 5 Litre Jug Puzzle

You may have seen this one in Die Hard: With a Vengeance... This question is based on the famous 3 and 5 Litre Jug Puzzle, but with a slightly different slant. Golf up some code that when given an ...
6
votes
8answers
465 views

Sum of indices of second least significant bit

This is a pure code-golf question. Input: A non-negative integer n Output: Sum of the indices of the second least significant set bit in the binary representation of the integers 0...n. If the ...
19
votes
1answer
3k views

Create a C preprocessor

The goal is to create a preprocessor for the C language, as small as possible in terms of source code size in bytes, in your preferred language. Its input will be a C source file, and its output will ...
-1
votes
3answers
130 views

Compute the greater common divisor & the smallest common multiple of N numbers

Your mission is to write 2 functions that accept a list of N integers (positive or negative). N can be higher than 2. The first one returns the greater common divisor of the N numbers Example: [10, ...
24
votes
6answers
3k views

Flappy Bird Clones :)

Everyone's been freaking out about that stupid "Flappy Bird" game being removed. So, your task is to crate a Flappy Bird Clone game. Its really simple. Here are the guide lines: It can use either ...
18
votes
8answers
3k views

Create a Roman Numeral calculator

Create a basic calculator for Roman numerals. Requirements Supports +,-,*,...
3
votes
0answers
656 views

Shortest Sub Segment Problem [closed]

Given a paragraph of text, and a list of k words, write a program to find the first shortest sub-segment that contains each of the given k words at least once. The length of a segment is the number of ...
18
votes
5answers
974 views

Tips for golfing ASCII art

I think the ASCII art questions on PPCG are fun to do, but personally I think it can be pretty hard, especially when the question is tagged as code-golf. I wonder if anyone here might have some tips ...
102
votes
157answers
15k views

Execute prints backwards

Your task is to reverse the order in which some prints get executed. Specs: Your code will be in this form: ...
24
votes
16answers
10k views

Create an analogue clock

Create an analogue clock Goal: To create a working analogue clock using any programming language. Requirements: Your clock should feature at least the hour and minute pointers. The produced clock ...
14
votes
4answers
910 views

Write code to determine the accepted answer

Post an answer to this question that evaluates any answer to this question and determines whether it wins. Who wins: Winner is the answer that wins according to the most answers at 1700 UTC, Sunday, ...
15
votes
9answers
1k views

Tips for Golfing in Batch

Windows Batch (CMD) is probably the least suitable language for code golfing. Avoid newline characters. If you're looking for the shortest code in bytes, as opposed to characters, you will want to ...
6
votes
4answers
408 views

Prepare data for JS renderer

It's asked to write a script to generate a source data to feed a JavaScript renderer. JS Renderer documentation The JS renderer is this script: ...
0
votes
4answers
2k views

ASCII-art videogame edition [closed]

I thought it might be fun to throw this on here. Generate an ASCII-art for one of your favorite videogames. What you want to generate is up to you but it should meet 2 requirements. It should be ...
6
votes
19answers
1k views

Write a program for splitting the string with alternative spaces

Write a program in the minimum number of bytes that prints a string split into chunks of every length from 1 to the string's length (ascending and then descending), separated by spaces. Example <...
4
votes
1answer
317 views

Tips for golfing in Delphi

Code-golfing is incredibly fun to do, trying to solve the given problem is one thing but the real challenge is getting your code as short as possible. Some languages are perfect for golfing because ...
6
votes
2answers
303 views

Eco-ize data for printing

Inspired by ecofont. Given a string containing # and , output it more eco-friendly by cutting out circles, while keeping it "...
13
votes
12answers
8k views

Make a Valentine wish with your favourite language [closed]

Write the most creative program to display your Valentine wish to your favorite programming language, in that language. E.g. ...
12
votes
10answers
850 views

String of alphanumeric characters to a sorted list of comma-separated ranges

Given a string of unsorted alphanumeric characters, e.g. ABC321STPpJqZZr0 output a ", "-separated list of character ranges, sorted by ASCII value, ignoring case ...
7
votes
1answer
610 views

Graphical, networked, two-(human)-player Tic-Tac-Toe

Create a Tic-Tac-Toe game that allows two human players to play against each other using two networked devices. Requirements: Network play. Program must let both players know whose turn it is. ...
13
votes
38answers
3k views

Count occurrences of an integer [closed]

Based on the question How many positive integers < 1,000,000 contain the digit 2?. I'm looking for the most creative solution to count all the Integers from X to ...
2
votes
12answers
3k views

Sort an array only using recursion

Your task is to write a function that sorts an array. Your function: Cannot call other functions (excluding itself, of course); Must receive an array of integers as input, and it must return the ...
11
votes
5answers
526 views

Euler's Front 9

  Project Euler is another fun programming challenge site to compete (well, play) on. Early problems start off gently, but then explode in difficulty beyond the first hundred or so. The first ...
65
votes
12answers
11k views

Insert typos into text

I wrote some text, but it looks too professional. I want to make it look like I was really tired when I wrote it. I need you to insert some typos. Your challenge is to take an arbitrary single line ...
7
votes
2answers
885 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 ...
6
votes
2answers
314 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 ...
6
votes
9answers
1k 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) ...
2
votes
5answers
313 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 ...
5
votes
9answers
5k 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 ...
-2
votes
1answer
7k views

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

I have this function to generate UUID's: ...
1
vote
1answer
270 views

Computer Generated Olympic Theme Song [duplicate]

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 ...
7
votes
2answers
314 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
3k views

Match strings whose length is isolated prime [closed]

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 an ...
12
votes
7answers
2k 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
262 views

Output in the Correct Order

Ok lets say we get a input the following csv file (all entries are quoted strings) ...
10
votes
10answers
2k 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
votes
4answers
1k views

Linkin Park Logo [closed]

Your goal is to draw the Linkin Park Logo in minimum bytes. Please add a title with the language and the number of bytes in your code.
6
votes
7answers
846 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
votes
4answers
265 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 ...
27
votes
15answers
2k 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 ...
8
votes
9answers
785 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
11answers
735 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 ...
39
votes
33answers
16k views

ASCII art “Hello-World!” [closed]

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 (" ")...
27
votes
23answers
4k 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 ...

15 30 50 per page
1
202 203
204
205 206
234