22
votes
9answers
761 views

Minimal NetHack

NetHack is a roguelike game where a player must retrieve the Amulet of Yendor from the lowest level of the dungeon. Commonly played via telnet, the entire game is represented with ASCII graphics. The ...
0
votes
0answers
61 views

Multiples of 3 and 5 [on hold]

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. This is The ...
17
votes
15answers
1k views

Write a program that finds the most occurring paired letter in a string

The program must output the letter that is paired the most. For example, if your program was given the following string: "Sally's friend Bobby searched for seashells." it must output L because "ll" ...
11
votes
3answers
305 views

Uniquely separated pixels

For an N by N image, find a set of pixels such that no separation distance is present more than once. That is, if two pixels are separated by a distance d, then they are the only two pixels that are ...
8
votes
4answers
281 views

Print an ascii spiral in O(log n) memory

You may write a program or function that receives an odd, positive integer n, where n >= 3, as either a function argument, command line arguments, or on STDIN (or equivalent for your system), and ...
9
votes
5answers
343 views

High Precision Metallic Means

Background The metallic means, starting with the famous golden mean, are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring ...
9
votes
0answers
94 views

The GOLF CPU Golfing Challenge: Prime Partitions

This challenge is the first of a series of fastest-code problems that should be written in the GOLF CPU. A partition of a number, N, is a list of numbers that add up to N. A prime partition is a ...
29
votes
14answers
2k views

Staircase writing

Write a program or a function that will output a given string in a staircase fashion, writing each part of a word that starts with a vowel one line below the previous part. For example: Input: ...
0
votes
0answers
98 views

Solving the rose garden view point problem [on hold]

In Ooty, India there is a huge rose garden. There are 4000 rose species there. Since there are so many species, authorities decided to make some view points to enjoy views. Now from 1 view point one ...
5
votes
1answer
104 views

Tokenize a String [duplicate]

Write a program or function that takes in a string through STDIN or function parameters, tokenizes it by parenthesis, and outputs the tokens on different lines. If the string contains a parentheses ...
26
votes
17answers
3k views

Leap for Leap Seconds!

Since today marks the occasion of the 26th leap second ever to occur, your challenge will be to output the date and time of every leap second in GMT or UTC that has occurred so far, as well as the one ...
-3
votes
0answers
66 views

bit counting of an integer in ternary operator [on hold]

Following computes the number of bits set in an integer. int main() { int num = 7, mask = 1; int setBitscount = 0, cnt = 0; while(num) { if(mask & num) setBitscount++; num >>= 1; } ...
0
votes
0answers
81 views

What does this say? [on hold]

A geek friend of mine said that this was what he was listening to and I'm apparently supposed to figure it out: (?ix)(?![AD-ZC][a-jn-zjm]) ( ([[:upper:]]) [[:lower:]] ) (?=[a-z]) (?!b-z) (.) ck ( ...
10
votes
4answers
496 views

The very weird word counter

INPUT: Any string consisting exclusively of lowercase letters via function argument, command line argument, STDIN, or similar. OUTPUT: Print or return a number that will represent the sum of the ...
-2
votes
1answer
95 views

Print n-z characters of Unicode table [on hold]

The challenge is to write a program which outputs all characters of the Unicode table from n to z range. For code "0000" is the first in order and you must skip all blank Unicode combinations. For ...
13
votes
1answer
301 views
+50

Play a Song for Me

Challenge Given guitar tablature you must output the song represented by the tab. This may be to the speakers of your computer or to an audio file (.wav, .mp3, .midi, .aiff, etc.). There will also be ...
23
votes
23answers
3k views

Simple ASCII Gantt

This is a simple one: print an ASCII Gantt chart. Given tasks' ranges (start-time - end-time Tuples), print a Gantt timeline in the form of - characters for each task duration - each task in a new ...
-4
votes
0answers
108 views

Help with 2048 game in pascal [on hold]

This is a game i need to present for my programming class. It is the almighty 2048 game.. http://gabrielecirulli.github.io/2048/ and we have to do a simpler version in pascal language. This is the ...
5
votes
4answers
258 views

Find the optimal nim move

The game Nim is a mathematical strategy game, where 2 players take turns taking items from distinct heaps. On your turn, you must take at least one item, and you may take as many as you want, ...
7
votes
1answer
176 views

Snakes and Ladders probability of winning

(This is my first Q here, and I don't know much about code golfing.) Your aim is to predict the winner of an ongoing Snakes and Ladders game. INPUT A single number (2-1000) indicating the number ...
23
votes
6answers
603 views

National Scheduling Conflict Championships

(I meant to post this while 1542: Scheduling Conflict was still the current xkcd, but I had a scheduling conflict.) Input The input will be a list of 3n elements, which represent n events. The ...
7
votes
4answers
328 views

Calculate the Orthocenter of a Triangle

Try to write the shortest program or function you can that prints or returns the calculated orthocenter of a triangle. The orthocenter of a triangle is the intersection point of the three altitudes ...
-1
votes
0answers
64 views

Simple Path to Route Algorithm [closed]

I'm currently conducting research into subway paths, but stand in front of a problem, with no programming knowledge and an extremely short time-limit. Probably the question I am asking is trivial, ...
17
votes
11answers
541 views

Determine ranges from a list of values

Given an unsorted list of unique, positive integers, output the shortest list of the longest possible ranges of sequential integers. INPUT An unsorted list of unique, positive integers e.g. 9 13 ...
30
votes
2answers
525 views

Poor man's LaTeX

You are transported in a parallel universe where people write mathematical equations on computers as ASCII art by hand. As a LaTeX addict, this is totally unacceptable, and you ought to automate this ...
0
votes
0answers
60 views

Lost in (programming langage) translation [duplicate]

The goal Write a program that when executed will output code instruction in another programming langage. This code snipet can then be run to output the original program itslef. The rules Any two ...
-5
votes
2answers
119 views

Solve the Diophantine Pell equation

Given a natural number c as input, our task is finding the fastest way to calculate one -atleast- availabe integer solution (a,b) of pell equation c=a²-b². Rules Built-in functions and loopholes ...
1
vote
6answers
274 views

Number of characters in an integer's name [duplicate]

The goal of this challenge is to show how many characters are in the name of a given integer. This is code golf, so the smallest code wins. RULES The input will be between 0 and 100 (inclusive). If ...
4
votes
0answers
197 views

Write an interpreter for my new esoteric language PointerLang

I designed a language in which pointer arithmetic is the main tool of programming. Here are some examples. (print 0 to 9) =9[>1=9-*-1.>-1-1] (print 1 to 10 with spaces in between, character ...
29
votes
26answers
2k views

Mass of elements

There are more than 100 elements in the modern periodic table. You challenge is to output the rounded mass of an element with respect to the input given. Input Input will contain an abbreviation of ...
-4
votes
0answers
26 views

clickable links within editor pane in java [closed]

i use GUI to make application & when i make the menus of the GUI i use help menu & make a sub menu for Developer of application & i put on it link of e-mail for every developer , i use ...
30
votes
18answers
2k views

The Ultimate Samurai Showdown

Introduction In this challenge, you are playing an arcade game titled The Ultimate Samurai Showdown Ultimate Edition Special Version 2.0 X Alpha Omega Turbo (or just Ultimate Samurai Showdown for ...
4
votes
0answers
134 views

Display a MIDI Track

Background MIDI files are quite different from WAV or MP3 audio files. MP3 and WAV files contain bytes representing a "recording" of the audio, while MIDI files have a series of MIDI messages stored ...
-3
votes
0answers
80 views

how the factorial of 16 (16!) can be accomplished by using multithreading? [closed]

how the factorial of 16 (16!) can be accomplished by using multithreading? Guys I got this question to solve, I'm not able to find out the approach. Can anyone help?
-2
votes
4answers
316 views

Write “Code Golf” without using any letters [duplicate]

Goal Your goal is to write "Code Golf" without using any letters [A-Z, a-z], even in your source code. It can't use of the following special characters either (!, _, <, (, ), ., {, }, ', and >). ...
17
votes
6answers
1k views

Nuggets of Code

Nuggets of Code It's a hypothetical situation where it is Friday evening, and you've invited over the usual golfing buddies to participate in your favourite hobby: code golfing. However, as this is ...
10
votes
3answers
223 views

Highest perimeter polyomino

This is code golf. The winner is the valid code with the smallest number of bytes. Challenge Given inputs M and N, the width and height of a rectangular grid of squares, output a polygon that ...
6
votes
0answers
103 views

Rotate a diamond tiling

Any regular hexagon can be tiled with diamonds, for instance like so (stolen from this question): ______ /_/_/\_\ /_/\_\/\_\ /\_\/_/\/_/\ \/_/\_\/_/\/ \_\/_/\_\/ \_\_\/_/ We'll consider ...
9
votes
2answers
205 views

Play a Perfect Game of 4x4 Hex

Background Hex is a two-player abstract strategy game played on a K×K rhombus of hexagonal tiles. Two opposite sides of the rhombus are colored white, and the other two black, and the two ...
-5
votes
4answers
164 views

Workweek completion

I work from monday to friday. I start my day at 8:12 and have lunch from 12:00 to 12:42. My workday ends at 16:30. If you are wondering why 8:12 and 12:42 -it's because 8:00 is the goal but it never ...
14
votes
2answers
261 views

Fill a water balloon

In this challenge, you must display ASCII art of a water balloon given the amount of water that the balloon is filled with: | __||__ | | / # #\ | | |######| | | |######| | | |######| | | |######| ...
9
votes
3answers
289 views

Too many pawns on a chess board

Given an integer 2n, find the number of possible ways in which 2n^2 black pawns and 2n^2 white pawns can be arranged on a 2n by 2n chess board such that no pawn attack another. A black pawn can ...
8
votes
4answers
201 views

Ionic Compound Golf

Challenge Given two inputs, a positive ion and a negative ion, you must output the formula for the ionic compound which would be made from the two ions. This basically means balancing out the charges ...
-6
votes
0answers
83 views

Crack this broken cipher [closed]

Recently i got an email from the organizers of a congress i was attending. They were sponsored by an IT-Corporation which devised a crypto challenge. I cracked the cipher using 2 standard shell ...
8
votes
10answers
819 views

Triangular Square Numbers

Square numbers are those that take the form of n^2 where n is an integer. These are also called perfect squares, because when you take their square root you get an integer. The first 10 square ...
0
votes
0answers
79 views

Rubiks Cube Challenge 2 [closed]

Objective Build a program that does two things: 1) It must randomly generate a Rubik's cube consisting of six colors of your choice - meaning, your program doesn't need to draw a cube, but should be ...
39
votes
22answers
4k views

First code golf decathlon

Tasks All competitors try to solve the following list of 10 tasks: math Read a positive integer n from input and return the sum of the cubes of the first n non-negative integers. For input 1, ...
4
votes
2answers
184 views

Cut a silicon wafer into dies

When manufacturing chips, circular silicon wafers are cut into dies of needed size: The goal of this challenge is maximizing the number of whole dies that can be cut from a wafer of a given ...
17
votes
9answers
1k views

Draw Growing Stacks of Boxes

The Task In this challenge, your task is to draw an ASCII art representation of several stacks of boxes of increasing height. You are given as input the number of stacks, which is a positive integer. ...
0
votes
0answers
7 views

Confusing puzzle [migrated]

I have come across a puzzle, which makes no sense. Does anyone know the answer to the below? (apologies if this is not the right use of this forum!): "You and two friends go on holiday. When ...

15 30 50 per page