For challenges involving simulation.

learn more… | top users | synonyms

4
votes
1answer
201 views

Let's play ASCII mini-golf [on hold]

Let's play code golf... by playing golf. Input Your input will be a string consisting of #'s, an o, an @, and .'s. For example: ......@.. .....##.. ......... ......o.. . - playable golf course ...
1
vote
0answers
154 views

clickerhero mercenaries

Introduction I have recently started playing clickerheroes again. In the recent patch they introduced a new mechanic to mercenaries: their lifetime. Instead of having a random chance at dieing now ...
1
vote
0answers
70 views

Code Golf Pro Golfer Least Swings Calculator

Your Challenge: For a golf Course Of Inputted 'n' length to hole where: 'n' is a whole number and a multiple of 5 between 150 and 500 and 1 integer in code = 1 metre You must calculate the least ...
49
votes
16answers
4k views

Code (Mini) Golf

Given a side-view of a mini-golf course and the power of the swing, determine if the ball will make it into the hole. A course will be in this format: ____ ____ _ __/ \ / ...
11
votes
1answer
177 views

Attraction Between Words

Newton's theory of gravitation says that the gravitational force between two point masses is F=(Gm1m2)/ r2 Where G is the gravitational constant: 6.674×10−11 N · (m/kg)2 m1 is the mass of the ...
9
votes
0answers
93 views

Chess-olition Derby

What could be more polar opposites than chess and demolition derby. You would think that no one who enjoys one would enjoy the other... until today. Rules The starting position is a standard chess ...
12
votes
10answers
959 views

9 Deaths of the Ninja

Inspired by this conversation in chat. Your goal in this challenge is to emulate a ninja and count how many deaths he has left. Specs You ninja starts out with 9 deaths left. He also gets an ...
8
votes
6answers
217 views

Card pair probability

Given a deck consisting of N copies of cards with integer values [1,M] for a total of N*M cards, compute the probability that a card with the value of 1 is adjacent to a card with the value of 2. ...
27
votes
4answers
846 views

Gravity simulator

Statement You are given a still of a series of balls falling in a 2D grid. This grid is surrounded by immutable and unbreakable walls so all the action in contained within them. Your task is to ...
54
votes
4answers
1k views

Simulate the Universe!

One nice property of a Turing-complete language is that it can be used to write any program, up to and including the simulation of the entire Universe. Your job is to do exactly that: write a program ...
15
votes
1answer
470 views

Code me some golf

If you haven't played golf before, here's a list of golf-related terms I use in this question Shot, also called a stroke: Every time the ball is hit, this is a shot. Hole: A golf course is split ...
26
votes
3answers
3k views

Help, I'm trapped in an infinite factory!

This challenge is loosely inspired by the Zachtronics game Infinifactory. You are given a top-down view of a rectangular grid of conveyors, represented by >v<^. There may be cells without ...
17
votes
8answers
957 views

Analyzing Earthquakes

Background The Random Domino Automaton is a toy model for earthquakes, inspired by cellular automata. In this challenge, your task is to simulate a simplified version of this model, and collect data ...
10
votes
2answers
255 views

Digits Digging a Dungeon

Edit: I will award a 100-reputation bounty for the first solver of the bonus puzzle at the end of the question! I will add the bounty to the question only when the answer appears as this ...
16
votes
3answers
296 views

Race of the Digits

You should write a program or function which given a starting order of distinct one-digit positive integers and the length of the track as input outputs or returns the finish order of the numbers. ...
5
votes
1answer
192 views

Finding Pairs for Letters

You should write a program or function which given a string as input outputs or returns a string or list of the lowercase letters in the order they find their uppercase pair. The input is a string ...
8
votes
1answer
307 views

Rock-paper-scissors competition simulator

You decided to organize a rock-paper-scissors championship to find out who is the best. You don't want to let luck to decide the winner so everyone has to give you his or her tactic in writing before ...
12
votes
3answers
777 views

Be an Epidemiologist!

Challenge You must create a simple model of how disease spreads around a group of people. Rules and Requirements The model must be a 1000 by 1000 2D array with each element being a different ...
3
votes
0answers
1k views

The World in the Future [closed]

In the future, the world will change, there's no doubt about it. For that reason, you have to produce a realistic map of the world n years in the future. The number n should be the number of years in ...
19
votes
4answers
2k 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 ...
14
votes
9answers
2k views

Simulate rotating a board

Introduction You're playing a matching game, in which coins are inserted at the top and fall to the bottom (onto the top coin) due to gravity. So this O <- inserting this coin OO O OOOOO will ...
11
votes
1answer
499 views

Where will the ball land?

Given a string where the first line contains spaces and one period (., the "ball"), followed by lines containing spaces, forward slashes (/), and backslashes (\), determine what column the ball will ...
16
votes
7answers
2k views

Predict where the man will go

A man lives in the north-west corner (0, 0) of a town with height h and width w . Everyday he walks from his home to the border (?, w) or (h, ?). In the following example, the man goes to (3, 3) ...
15
votes
10answers
1k views

Simulate a battle between two creatures

Welcome, brave code golfer! Today you will stand in the midst of a great battle between a goblin and an elf! goblin attacks elf! elf dodges! elf attacks goblin!     elf hits goblin for 13 ...
10
votes
2answers
806 views

Code Golf: What is the spaceship's fate? [floating point version]

This question is slightly harder than the ASCII art version. There is no art, and now you get to do some floating point arithmetic! The Challenge The U.S.S. StackExchange was traveling through the ...
8
votes
1answer
1k views

Simulate a (gravity-based) billiard-ball-type computer

The Machine A billiard-ball type machine is composed of only the symbols \ _ / along with upper- and lower-case letters, spaces, and the number 1. \ and / are ramps. A ball coming from above will be ...
16
votes
3answers
3k views

The strange life of a beehive

Researchers recently discovered an interesting bee colony that lives in an infinite field of honeycomb: Each cell can house a bee or not. In fact, the lives of those creatures appear to be a bit ...
15
votes
5answers
2k views

Code-Golf: Lights Off!

The shortest code to pass all possibilities wins Many grid based games have been made that start off with a grid of lights that are switched on. Pressing any of the lights causes that light and the ...