Questions tagged [simulation]

For challenges involving simulation.

46 questions
Filter by
Sorted by
Tagged with
4k views

Simplified Piet Interpreter

Background Piet is an esoteric stack-based programming language in which programs are images meant to resemble abstract paintings. To keep the challenge from being unnecessarily complex, you will not ...
• 13.7k
514 views

Resolve a Super Auto Pets Round

In Super Auto Pets, players build teams of animals that face off in battles to the death unconsciousness. Each animal has an Attack and Health value, and combat occurs in iterations of the following ...
• 1,513
2k views

Climbing the Bookshelf

Introduction You're making a robot that can navigate a set of books of varying heights. It can climb books and jump off books, but if the distance is too big it will stop to prevent damage. To figure ...
• 5,700
202 views

A Suitable Mission — The Professor's Revenge

Summer Klerance turned in her term assignment for this challenge. Her professor was miffed (but also amused) when he overheard a disgruntled classmate of Summer's saying she got her answers by ...
• 636
470 views

A Suitable Mission

Summer Klerance, a senior in college, is what her teachers refer to as GBL*. Students in her probability class have been assigned individual problems to work on and turn in as part of their final ...
• 636
2k views

Pass The ⚽️ Around The Circle

The ball game is a game in which a number of players sit together in a circle. Each player is first assigned a number $n$, either 1, ...
• 22.7k
972 views

Produce an image based on an elementary cellular automata ruleset

What is elementary cellular automata? Since I'm not sure I'll be able to explain this so that somebody who has never heard of this is able to understand, I'm giving an explanation from https://...
• 3,950
271 views

Simulating Crashing Cars

Introduction I have some ASCII cars that have velocity and direction. Their velocity is represented by their number. If a car is <> then it has stopped. For ...
• 729
1k views

Simulate a model neuron

An Izhikevich neuron is a simple yet quite effective model of a biological neuron, designed for use in a discrete time-stepping simulation. In this golfing challenge, you will be implementing this ...
• 29.1k
3k views

Implement the Boids algorithm

Introduction The Boids Algorithm is a relatively simple demonstration of emergent behavior in a group. It has three main rules, as described by its creator, Craig Reynolds: The basic flocking model ...
• 612
316 views

52 Week Challenge [duplicate]

The 52 week challenge is a way to save money. For example, Week 1, you save $1.00. Week 2 you save$2.00, and it continues through the year, adding one more dollar to each week’s savings goal. By Week ...
• 75
3k views

Will I make it out in time?

Inspired by this. Background The evil farmer has decided to burn your wheat field down in order to drive up the prices. To ensure total destruction, he has also soaked your field in gasoline. Even ...
• 17.9k
7k views

Kill it With Fire

Disclaimer: The story told within this question is entirely fictional, and invented solely for the purpose of providing an intro. I am an evil farmer, and to drive up the price of wheat in my area, ...
• 7,235
364 views

Playing with robots for kids - Which letter will I reach?

TL;DR: Given an array of chars and a robot in a starting position of the array, write an algorithm than can read a string with movements (F for "go forward", ...
• 12.9k
2k views

Fire propagation simulator

Suppose we have a matrix like this: 11111 12221 12321 12221 11111 This matrix represents a terrain, and each cell represents a portion of terrain. The number in ...
• 12.9k
444 views

Solve this uHerbert challenge

TL;DR: Solve this particular challenge, a robot simulation, by stepping on all of the white pads, and avoiding the gray pads. You can step on a white pad any number of times, as long as you step on ...
• 183
1k views

ASCII-Art Zombie Invasion Simulation

To simulate a zombie invasion, start with a grid of # and representing the map: ...
• 15.5k
676 views

Text adventure games have a pretty set formula; there's a world composed of a series of rooms / spaces, the player can move around these rooms, and there are some items in the rooms. Items can be ...
• 8,479
336 views

Let's play ASCII mini-golf [closed]

Let's play code golf... by playing golf. Input Your input will be a string consisting of #'s, an o, an ...
• 677
343 views

clickerhero mercenaries [closed]

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 dying now ...
• 2,625
302 views

Code Golf Pro Golfer Least Swings Calculator

Your Challenge: For a golf Course Of Inputted 'n' length to hole where: ...
• 67
5k 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.2k
309 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 ...
• 6,676
372 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 ...
• 6,676
1k 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 integral ...
• 25.7k
301 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. ...
• 2,733
2k 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 is contained within them. Your task is to ...
• 1,516
6k 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 ...
• 8,109
890 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 into ...
• 7,387
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 ...
• 197k
1k 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 ...
• 42.7k
356 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 bounty has no ...
• 20.9k
392 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. ...
• 20.9k
280 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 ...
• 20.9k
571 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 ...
• 20.9k
910 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 person....
• 23.4k
2k 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 ...
• 23.4k
3k 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 ...
• 2,073
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 ...
• 2,444
1k 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 (...
• 2,634
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 ...
• 1,197
2k 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! ...
• 71.5k
1k 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 ...
• 29.1k
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 ...
• 29.1k
4k 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 ...
• 13.1k