[STATUS: CLOSED!]
Make sure your EPVP name is not the same as the Arma 3 profile name. KoTH Admins watch this thread.
ID verification is now required.
Arma 3 King of the Hill Fully External XP/Money Service 100% Undetectable! KoTH Anti Cheat BAN WARRANTY!
Works on all servers!
My method is 100% unique! It does NOT use the memory editing exploit!
Unlike others that use a memory editor to increase only your cash and XP, my method also increases your King of the Hill hours to make your profile look completely legitimate!
I do not need access to your account nor will you need to run any scripts, or executables!
PRICING (Group discounts are available just message me):
If you just want the cash and no levels the price is the same!
*Free cash refills once you run out.
Time taken for order completion: 5 minutes
Every single person gets a random amount of XP and money so no two customers have the exact same amount of XP and money.
I am only providing this for KoTH at the moment. Do not PM me regarding other MODs.
100% Satisfaction Guaranteed With All My Sales
Vouches:
Originally Posted by OutbackJack He showed me a demo and it was working great. Has fair prices, is nice and helpful. This is probably the safest method that is ever going to be developed. 10/10 would do again |
Originally Posted by GNLKing1 Just bought the service today, all went down smoothly. I went first. I definitely recommend this guy! |
Originally Posted by MrBigDong +1 Legend gave me a demo to prove it, went smoothly worked perfectly. Seams like you wont get banned straght up so i'll report back if anything happens. Cheers mate, legend |
Originally Posted by Hipsteris Everything went fine. Even at 6am at his time. Fast and smooth, no problems. +1 |
Originally Posted by IVIaximumPower |
Quote:
+Rep Answered all my inquiries, showed me a demo, and went first and received everything discussed right after. Would highly recommend him |
Originally Posted by Masterjake912 This guy is completely legit. Even shows proof by giving you some free xp and money. Definitely recommend this guy. |
Originally Posted by slayerh4x Just got this from him and everything went smoothly. Thanks! |
Originally Posted by DayZ Family +rep just bought a couple levels and some money off this guy and everything went very smooth and quick. I definitely highly recommend you purchase off him if you are thinking about it! |
Originally Posted by Legacyisborn Great guy overall made things very easy. Showed you how it works before you even pay helping you understand it works, would recommend if your looking for some dank cash to help out your gameplay |
Originally Posted by centuri0n7 |
Quote:
Vouch for this guy. Helpful and friendly and totaly private method! |
Originally Posted by miggylattan11 +Rep ,.,.,., All went well. Vouch for this dude. 10/10 would buy again and refer! Edit: You get few benefits from buying from him, buy a service and u wont regret it +rep 100x over |
Originally Posted by blacksarecacks just bought $45 level and xp from him and hes legit. +1 |
Originally Posted by DDAMIAN +1 just bought some lvl's + money! totaly legit, its a really fiendly and nice guy |
This 'Sandbox' is a place where Programming Puzzles & Code Golf (PPCG) users can get feedback on prospective challenges they wish to post to the main page. This is useful because writing a clear and fully specified challenge on the first try can be difficult. There is a much better chance of your challenge being well received if you post it in the Sandbox first.
To post to the Sandbox, scroll to the bottom of this page or click on the 'Add Proposal' link below, and click 'Answer This Question'. Click 'OK' when it asks if you really want to add another answer. Write your challenge just as you would when actually posting it. You may also add some notes about specific things you would like to clarify before posting it. Other users will help you improve your challenge by rating and discussing it. When you think your challenge is ready for the public, go ahead and post it, replace the post here with a link to the challenge and delete it.
See the Sandbox FAQ for more information on how to use the Sandbox.
The Sandbox works best if you sort posts by 'active'.
Add Proposal
Search the Sandbox
- Most people include applicable tags in their proposal, so for instance you can search for all king-of-the-hill proposals by merely adding the tag name in quotes to the search query.
Browse your pending proposals
Get the Sandbox Viewer to view the sandbox more easily
To add an inline tag to a proposal use shortcut link syntax with a prefix:
Mego♦[tag:king-of-the-hill]
26.1k11 gold badge6767 silver badges122122 bronze badges
SandboxSandbox
$endgroup$2433 Answers
12345…82 next
$begingroup$Note: If you are seeing this first, you might want to sort by active.
squeamish ossifragesqueamish ossifrage
$endgroup$$begingroup$Waving Hands bot
This is a sketch for a king-of-the-hill contest for a game which is much more complicated than the previous questions in this genre. Implementing the test framework will be a lot of work and it will require a lot of debugging, so I want to get feedback on whether the game is too complicated before I start work on that.
Waving Hands (original known as Spellbinder) is a two-player simultaneous-turn-based strategy game. At one level it is quite simple. You have two hands. Each turn you perform an action with each hand. Sequences of actions performed with the same hand create spells, which have varied effects.
The first level of complication comes from the number of spells: 42. I don't intend to reproduce a list: there is an online rules page (which is backed up by archive.org should that fallback be necessary).
The second level of complication comes from the interactions between the spells. This is where debugging of the test framework is most likely to be needed. My plan is to allow complaints about the framework's implementation of the rules for a period of two or three weeks or until there are three posted answers, whichever is the later.
At each turn the bot will be provided with a full history (except for moves which the rules say it can't see, which will be so indicated). However, it will not be provided with any other identifying information about its opponent. I think that it will be hard to fingerprint some bots, although probably not all.
The framework will probably be written in Java and hosted on github. I intend to provide one or two wrapper classes for non-JVM languages, and a 'bot' which brings up a UI for human play, which will be useful for debugging and testing your own bot.
Under the label of fair play, it will be forbidden to attempt to interfere with the opponents or access their memory. A bot may store information about the current game, to save recomputing it each move, but it may not persist information between games. Competitors may submit more than one bot, but they must be independent: i.e. no submitting bots whose purpose is to help your favoured bot win.
To reassure anyone who's worried about copyright: the creator of the game has stated
I retain full rights to the game, and if any commercial incarnation appears then I want a royalty! I have no objection to people implementing or running derivatives of the Spellbinder so long as they make no money from it, though.
Normally upvotes in the sandbox indicate that you think the question is ready to post. This one clearly isn't. However, please upvote it if you think that the outlined proposal would make a good question. If there's enough support, I will create a separate sandbox answer when the test framework is ready for early criticism.
Peter TaylorPeter Taylor40.5k88 gold badges4747 silver badges111111 bronze badges
$endgroup$$begingroup$Here is an outline for a strategical King-of-the-Hill challenge which is loosely based on Risk (loosely enough so as not to preclude a future Classic Risk KotH).
It is far from complete, but I'm posting it here to gather feedback from the community to finalise the rules before getting down to implementing the control program. This would definitely make for one of the more complicated KotHs and I'd like it to be as fun as possible, so that it's worth the participants' time! I will probably leave this up for several weeks before starting work on the controller.
I wanted to try something new: The distinguishing feature of this challenge is that it does not use simultaneous turn-based simulation, but rather something similar to Final Fantasy X's Conditional Turn-Based Battle system. Different actions take different amounts of time, and it's simply your turn again when that time has elapsed. Of course, the control program will simply skip ahead to the next scheduled event.
There are probably more technical details in this post than what will be necessary for participants of the final challenge (and will most likely be presented in a different form then). I just wanted to include everything I've currently got, so people might point me towards issues in the underlying assumptions.
The Setting
The year is 2200: Mankind has spread out over the entire solar system. But we all know how much humans like other humans with different resources – interplanetary war has broken out. Each inhabited planet or natural satellite – collectively referred to as (celestial) bodies – starts out as one faction in this war. The goal is conquer as much of the solar system as possible.
The Model
The arena of the challenge is hence the solar system. I will include all solid planets and natural satellites with a diameter of 10 km or more (just for a bit of realism; this should provide a large enough surface area to build a base). There are 89 of those bodies – I could add even smaller objects should I get more submissions than that, but I think that's near impossible.
Note: I said 'solid' bodies. Jupiter, Saturn, Uranus and Neptune are gas giants and hence cannot be landed on (their satellites can be, though).
Planetary motion will be simulated, although in a simplified manner. Orbits are assumed to be circular and lie all in one plane, with a radius of approximately their real-life semi-major axis, and their real-life orbital period. Hence, no gravity is simulated – only simple (uniform) circular motion.
Satellite motion will not be simulated. Travel distances between satellites or between a planet and its satellites are assumed to be fixed (and will be determined once, by me, dependent on the satellites' orbit sizes).
The asteroid belt between Mars and Jupiter can be travelled to, but no bases can be built there – it acts mainly as a hideout. It is modelled as a continuous ring at fixed distance from the sun with fixed orbital period. Bots can choose to land their units at any position on the belt. Individual asteroids are not modelled – not even the larger ones like Ceres, which are way above the size limit.
Technically, the map is a complete graph whose vertices are the above 89 bodies plus the asteroid belt. The travel times between any pair of bodies depends on their distance at the time the travel commences (neglecting motion of the target during the travel). As planetary motion is simulated these travel times do generally change over time though. The future spacecraft is assumed to travel between 500,000 and 1,000,000 m/s and travels in straight lines, giving time scales between 10 seconds and 80 days.
For each match, the solar system will start out in a random configuration (each planet getting a random position on its orbit). Of course, that's not realistic, because the planetary configuration for 2200 is not going to be subject to change, but we need to keep the game fair.
Gameplay
- Each player starts with a base on a random body. The remaining bodies will be uninhabited.
- Each player starts with one flagship, and n fighters (where n needs to be determined, but I'm thinking on the order of 10) – collectively referred to as units.
- Players write a bot that is asked for a move whenever one of their own units is idle or needs to act, because it's being attacked or similar.
- Fighters are a lot faster than flagships, so they will act as scouts as well, to avoid time-wasting travel with the flagship.
- Flagships can build new bases on uninhabited bodies, or take over enemy bases (the former taking longer than the latter).
- Each additional base immediately grants another n fighters.
- Each base regularly spawns new fighters (say, once a week). If a player controls an entire planet system (the planet and all satellites), the spawn rate on all bodies in that system is increased (to, say, once every five days).
- Flagships are vulnerable while working on bases. Either they can't interrupt the building process upon arrival of enemies, or such an interruption will cause the total build time to increase.
- Upon landing on a body, units can't leave immediately. They need to remain for p % of the time it took to get there (p ≈ 10?) in order to refuel. Technically, this is to prevent units from hiding all the time in interplanetary space. (formula subject to change)
- If there are units from multiple players on a body, they may engage in combat (see next section for details on combat).
- If a player's flagship is defeated they immediately lose the game! All their units and bases go over to the player who killed the flagship.
- The bot may always decide to wait idly (I'll set a minimum on this, to prevent bots from spamming the control program with millisecond waits). Waiting will be interrupted by any relevant event like allies or enemies arriving somewhere.
Combat System
- Fights are carried similar to the rules of Risk. Please refer to the Wikipedia page or the internet for the exact rules for now – all necessary rules will be part of the final challenge post though.
- Attackers may choose to attack with 1 to 3 units, defenders choose to defend with 1 or 2 units. The outcome is determined by rolling dice. After each round of battle, battle may either continue with the remaining units or be aborted.
- One round of combat takes 1 day. (subject to change)
- Whether a player is attacker or defender depends on whether he has a base on the current body. This means that two attackers could be fighting each other on an unclaimed body, in which case both may use 3 units in a fight, but units from both sides die in a tie.
- If a player has a flagship on the body where the fight takes place, one unit will roll a d8 instead of a d6, unless they are currently working on a base (building one or converting one).
- When players lose units, they always lose fighters first. Hence, if a player has a flagship on a planet, and loses less than all of his units, the flagship will remain.
Implementation
I will either go with Rusher's approach of writing a Java controller where participants only need to implement an interface (and provide a wrapper for non-Java submissions) or I'll write a controller that invokes bots as separate processes whenever its their turn.
On their turn, each bot will be provided with
- the current time
- the number of bases and units controlled by each player
- the state of all bodies the player currently has units or bases on
- the ID and location of the idle unit(s) that can currently perform an action
- a list of all bodies with their current positions (in Cartesian coordinates, so distances can easily be determined)
- potentially I'll just provide a list of travel times for each idle unit instead, to save the bots the need to compute those
- a list of all bodies with their current angular positions
The latter can safely be ignored, but is provided for bots that want to predict planetary motion to take shortcuts. Static numerical data like orbital radii and periods will not be provided to the bots, but I'll publish a table with the challenge to be hardcoded into the bots if desired.
Further Design Decisions
I realise that there is a lot of complexity in this. This is why I need your help to refine the concept and remove unnecessary details while keeping the heart of the challenge in tact (while making sure the rules are consistent). Please give me all the feedback you can think of, but here are a few particular questions I have in mind that need to be answered:
- How should vulnerability during base-building be modelled? By penalising or by disallowing interruptions?
- How can fights between more than two parties be handled?
- Is the 'refuelling' necessary/useful? Do the details for it need work?
In any case, I don't doubt this challenge will remain fairly complex when finalised. It might help to gather some momentum if a few heroes volunteered up front to submit a bot to this - ideally ones which show that the entry barrier doesn't need to be as high as it looks.
Anyway, thanks a lot for reading this and helping out with the design of this challenge!
I'm happy to discuss details in chat (The Nineteenth Byte or Golf/Puzzle Lab; but ping me so I know you've posted there) or just here, but this challenge may need more discussion than fits in comments.
Community♦
Martin EnderMartin Ender170k99 gold badges161161 silver badges274274 bronze badges
$endgroup$$begingroup$Your challenge is to make a bot that plays a simple RPG game against other bots.
The Board
The board is a 500x500 2-dimensional array of cells. In any cell, there is one of the following:
- Nothing.
- An obstacle. Cannot be occupied by anything.
- A player.
- A monster.
Mechanics
Each turn, a player can:
- Move: you can move north, east, west, or south, or not move at all. Attempting to move into an obstacle, or off the edge of the board, will result in you not moving at all.
- Perform a special attack: you can either perform a ranged attack, an area attack, or no special attack at all.
- Battle: if you encounter an enemy, you can fight them.
Combat
Whenever you enter a square that is already occupied by a monster or another player, you fight them. You and your opponent take turns attacking each other, with the first move being decided randomly. At any point in the combat, you may flee. Also, once per battle, you may use a special attack which does double damage.
Damage is calculated using this formula:
Damage = Attacker's attack modifier + Random number from 1 to 5 - Defender's defence modifier
Special Attacks
There are two special attacks: A ranged attack, that targets any enemy within 5 squares, and an area attack, that targets all enemies within 2 squares. Damage is calculated using the same formula as for melee damage.
Monsters
In the game, there are 5 monsters:
- Goblin. Attack: 1; Defence: 1; HP: 1; moves randomly; 1XP for killing.
- Orc: Attack: 3; Defence: 2; HP: 5; follows players; 5XP for killing.
- Troll: Attack: 5; Defence: 2; HP: 10; moves randomly; 10XP for killing.
- Giant: Attack: 10; Defence: 5; HP: 15; follows players; 50XP for killing.
- Dragon: Attack: 20; Defence: 10; HP: 20; follows players; 100XP for killing.
If you kill another player, you receive 100XP.
Attributes
When you create your bot, you must give it 5 attributes. They are:
- Attack: your attack bonus when using a melee attack.
- Ranged Attack: your attack bonus when using a ranged attack.
- Area Attack: your attack bonus when using an area attack.
- Defence: your defence bonus.
- Constitution: added to your HP (10 by default).Note: If your bot's constitution is -10, it dies immediately.
These attributes must sum up to 12. They may be anywhere between -10 and 22.
Here are the additional functions you get for your convenience:
Entity surroundings(int x, int y)
- returns an entity representing what is located at that point. x
and y
range from -5 to +5, with 0, 0 being the square where you are. Trying to access outside that range will result in an Exception
being thrown. Entity
is one of:Entity.NONE
- nothing.Entity.OBSTACLE
- an obstacle or the edge of the map.Entity.PLAYER
- either you or another player.Entity.GOBLIN
- a goblin.Entity.ORC
- an orc.Entity.TROLL
- a troll.Entity.GIANT
- a giant.Entity.DRAGON
- a dragon.
At the beginning of the game, the field is randomly populated with 300 obstacles, 1000 goblins, 500 orcs, 100 trolls, 50 giants, and 10 dragons.
void setTargetX(int x)
and void setTargetY(int y)
- set the target x and y indexes of the ranged weapon. Indexes range from -5 to 5, with 0, 0 being your location. Passing these functions an index outside the range will result in an Exception
being thrown.The winner is the bot that acquires the most XP before it dies.
totallyhuman13.8k11 gold badge55 silver badges1818 bronze badges
AlexAlex
$endgroup$$begingroup$code-challengeaudio (dsp?)
http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/66a3aDTMFpad.jpg/320px-66a3aDTMFpad.jpgOur spies have intercepted super-secret codes being sent to the enemy in some archaic code! Can YOU decode the captured signals and save the republic?
Find the audio clips at this GitHub repo or in this repo ZIP (7 MB).
Each audio file is 8 kHz and 16-bit, provided in both WAV format and text where each line is one sample. Each file contains 30 tones, each no shorter than 100 ms and with an inter-symbol gap also no shorter than 100 ms of 'silence' (subject to noise). The
testtones.wav
file contains all digits, each 200 ms long, separated by 200 ms.For reference, each of the symbols/tones/keys/digits is comprised of two superimposed sine waves:
The difficulty increases as the files progress, with ever-increasing amounts of noise present.
level01.wav
is basically perfect (except for unavoidable quantization noise), level02.wav
starts at a signal to noise ratio of 10, and level08.wav
has a SNR of about 1 (equal parts signal/noise). The last file (level16.wav
) has a signal to noise ratio of approximately 3%, pretty awful, but I think the theoretical limit is down at about 0.1%. That may be the case only if you know the symbol timing, however, and here the symbols are of variable length.Your score is the highest level file you can decode without error, with additional tiebreaker points for tones successfully decoded from the next higher difficulty.
- Generate your own DTMF WAV file (might use this for a test file, or convert this to text if needed): http://www.audiocheck.net/audiocheck_dtmf.php
- Play with buttons (they like to get stuck on..): http://onlinetonegenerator.com/dtmf.html
- Cheat and use a web resource: http://dialabc.com/sound/detect/index.html (works up to about level 8, no, you can't actually use this.)
Nick TNick T
$endgroup$$begingroup$Just like chess, except that instead of two opposing armies, it's a free-for-all among the pawns.
The two players alternate moves. The allowed moves are to move a pawn one square forward (if the square ahead is unoccupied); if the pawn is on its initial position, to move it two squares forward (if the two squares ahead are unoccupied), or to capture a pawn that is one square ahead diagonally. Pawns do not promote upon reaching the last row and there is no en passant. The player who is left without a legal move loses.
This is an example of an impartial game.
feersumfeersum
$endgroup$$begingroup$This is an image of our wonderful pet platypus @Cyoce.
This is also an image of the same person, or is it?
(hint: it isn't)
Your task is to determine whether a inputted image is @Cyoce in disguise..
The input may be taken in any form. It will also always be 256*256px.
You will compare the image to the top image, @Cyoce profile image.
If the image is not within 1000 units of the profile picture, you must output the phrase 'I can't believe it's not platypus!!!' exactly.
A unit is decided by the following:
- If a given pixel is rgb(255,255,255) in the inputted image and rgb(250,250,250) in the martin image, it is 3 units away. That is one unit per 5 rgb points off. So rgb(100,120,100) vs rgb(100,100,100) is 4 units off. Floor the units, so 255 vs 253 is just 0.
- Calculate that for each pixel, and sum the units.
If the inputted image is more than 1000 units off, output the title phrase 'I can't believe it's not a platypus!!!'
- This is in development.
- Test cases coming later. Feel free to provide some.
- If somebody has code they would like to donate to me for test case generation, please do. :P
- I might change the units req. to a higher number depending on how this turns out.
- Any other advice?
RɪᴋᴇʀRɪᴋᴇʀ
$endgroup$$begingroup$Lions and bears are extinct, the wolves dominate the fauna on land. But in the depths of the sea the battle for survival rages on.
This is the spiritual sequel to Rainbolt's Survival Game, with a few additions. The arena is the sea and hence three-dimensional. Furthermore, you can choose one of three different species this time: write your bot as a whale, a shark or a giant squid!
The Arena
The game is carried out on a three-dimensional grid: +x points East, +y points North, +z points up. There will be
20*√n
cells along x and y, where n
is the number of participants. The height will always be 21 cells. There are five regions: three are the species' breeding grounds, and two are just non-special regions in between. The 21 layers are distributed as follows:The board wraps around along the x and y directions but not along z.
Each cell will be populated by at most one animal or hazard.
The Game
Each bot starts with 100 instances randomly distributed in its own breeding layer.
Every turn, each bot can do one of two things:
- Move: The move can be one cell in any orthogonal or diagonal direction (as well as staying in the same cell, which technically shouldn't be called a 'move'). Moves off the board (above the top or below the bottom layer) are ignored.
- Breed: Each animal starts with a breeding counter at 100 which is decremented every time step if it's greater than 0. If the counter is zero and the animal is in its species' breeding ground, there is a 10% chance that a new animal will spawn on a random (orthogonally or diagonally) adjacent cell - this new animal will simply be a new instance of your bot. If this happens, the breeding counter is reset to 10.
If two animals or hazards move to the same cell they fight until only one of them remains. If more than two animals (or hazards) move the same cell, two of them are picked randomly for a fight until there is only one survivor left. For details on fighting see below.
Your animal will be provided with the arena size, a 3x3x3 map showing its immediate surroundings, its breeding counter and its global z coordinate.
The winner will be bot with the most specimen (instances) surviving after 1000 rounds.
The Species
Your choice of animal determines where in which layer of the arena your animals can breed (see The Arena) and will give you one distinct skill:
- Whales (
W
) start with 10% more specimen. - Sharks (
S
) can make an additional Move before their regular action. They will receive their updated surroundings after the first move. The first move must be made into an empty cell or it will be ignored. - Squid (
Q
) can see further and are provided with a 5x5x5 map of their surroundings.
The Hazards
Each layer has a distinct type of hazards which will 'play' along the bots.
Fishing nets (
N
) sweep through the whales' breeding grounds. They will stretch across the entire depth of the layer and have the following pattern in the x-y plane:They constantly move in the +y direction. About half of the nets will point and move in the opposite direction.
Jellyfish (
J
) are found in the sharks' breeding grounds. If there's a jellyfish adjacent to another animal, that animal cannot move (unless that animal is also a Jellyfish). Jellyfish move in alternating pattern such that it always stays in the central 3 layers of the sharks' breeding grounds: twice down, twice up. If no animal is around, they will move straight down and in a random (possibly diagonal) direction up. If there is an animal in one of the 9 cells in the current direction, the jellyfish will move to that cell (or if multiple cells are occupied will pick a random one of these).Mantis shrimp (
M
) are only found on the ground (lowest z coordinate of the squid layer). Each turn there is a 10% chance that the shrimp will cause a cavitation bubble, which will blind all animals within a radius of 4 (Chessboard distance) for the next turn. They walk randomly but all in unison (don't ask me how they do it).Naval mines (
O
) are found in the regular layers between the breeding grounds. They never move. When stepped upon, the mine explodes, killing everything within a radius of 1 (Chessboard distance) including the animal that triggered the mine.There will be
30*n
hazards in each layer, where n
is the number of participants. The exception are the nets. There will be 2*n
nets in the whale layer.The Fights
Each fight is basically a non-uniform coin flip for who survives with the following probabilities:
- If a bot picked Breed it always dies.
- Nets are indestructible and hence always survive.
- Jellyfish and Mantis shrimp will survive with a probability of 1/3.
- If two bots fight, the odds are 50:50; except if one of the participants is in their own breeding grounds, in which case their chance of survival drops to 1/3 (because animals are unalert in their breeding grounds and that totally makes sense).
Sandbox notes
The controller has yet to be written, but I intend to do a Rainbolt-style KotH where you can either implement an abstract Java class or write a command-line script.
All numbers in the spec are subject to change until the challenge is actually posted.
I'm pretty sure the spec is currently incomplete (of course I/O is missing, but that has to wait until the controller is written), but currently I can't see the wood for the trees, so please point out the holes.
As usual, is anything unclear or could be improved? In particular, it will be hard to get the balancing right for this one, I think. I'm happy to discuss any questions or comments either here or in The Nineteenth Byte.
Community♦
Martin EnderMartin Ender170k99 gold badges161161 silver badges274274 bronze badges
$endgroup$$begingroup${{{rewriting}}}
Your task is to design and implement a new golfing language. The catch: it must only have 10 significant characters as commands.
Your language should have the following characteristics:
- It must be Turing Complete (theoretically).
- There should be at most 10 characters (of your choice) which are significant to the program. That is, any characters other than your 10 chosen characters should have no effect on regular program execution.
- You can choose to have these characters be removed via preprocessing or producing an error if there are any in the source code (before program execution; they should not be used to terminate the program early as an 11th instruction, nor be used to encoded additional information).
- Your selected characters should only consist of ASCII characters, unless:
- You want to use or create a code page for your language if you desire to use characters outside of the ASCII plane. Said characters should be translated into regular bytes.
- You should not design an encoding to a language, existing or not. As you are designing a language, your submission must be so. Submitting a “language” which is just a fancy way of encoding a Jelly program is therefore not allowed.
- By extension, this includes having one of your commands be an 'evaluate' function that is not for the language itself. So, you can't implement 'eval python' or 'execute shell code' functions.
- Your language should be capable of basic input (through STDIN and/or command line arguments) and output (to STDOUT, STDERR, and/or a file).
- You may choose to ignore any one of these I/O methods, as long as one of each is supported.
- Implicit I/O is acceptable.
Winning
1 week after no new answers are added, the winner is the language which completes the following tasks in the fewest total bytes.
All numeric inputs and outputs can be any (consistent) base, including unary.
1: Greetings, Humans!
Challenge: Output the following text, with or without leading/trailing whitespace:
Greetings, Humans!
Remove all the screws on the bottom of the laptop using a Phillips head screwdriver. Pull it up slightly to reveal the cable running from the bottom of the keyboard down to the laptop’s base, where it connects via the keyboard cable socket. Flip the laptop back over. Carefully free the keyboard from the laptop’s housing, as it will now be loose. If the cable is not in this socket, this is your problem. My dell laptop keyboard is locked.
Example Output:
2: Even cats
Challenge: Output every other byte of input, starting with either the first or second byte given.
Example Input:
Example Output 1:
Example Output 2:
3: Do the wave
Challenge: Given number
N
, output the first N
lines of the following infinite wave:4: Quine
Challenge: Write a non-empty program which outputs itself, character for character. It must be a proper quine.
5: Coprimality
Challenge: Given an integer $n$, output all integers $k$ coprime to $n$ such that $1le k le n$.
6: Ternary
Challenge: Given an integer
N
, output the base-3 (ternary) digits of N
.Note: You may not take input in base 3 for this challenge.
7: Word value sum
Challenge: Given a string consisting of only uppercase ASCII characters (
A-Z
), calculate the sum of their positions in the alphabet (1-indexed).8: Shutters
Challenge: Given an integer
N
, output a triangle of height N
, constructed according to the following algorithm:- The first row has
N
/
s. - The second row has
N - 1
/
s. - ..
- The second-to-last row has
2
/
s. - The last row has
1
/
s.
That is, the
K
th row has N - K + 1
/
s.9: Roll a die
Challenge: Given an optional seed (for randomness), yield a uniformly-random integer between 1 and 6.
10: Where am I walking?
Challenge: You will be given a list of at most four distinct characters representing the four cardinal directions. I will use
><^v
for the sake of example, but you may choose any other four characters. Suppose there is a point at the origin of a 2D plane. Each directional character moves this point 1 unit in that direction. Given this list, output the final destination of this point.11: Reproduction
Challenge: Write a program $P_0$ in your language which outputs another program $P_1$ in your language, which outputs another program $P_2$ in your language, which outputs another program… and so on. No two $P_j$ should be the same, that is, all programs generated should be distinct from each other.
Note: Your program may not read its own source code for this challenge. Standard quine rules apply.
12: Product
Challenge: Given an optional integer
N
and N
additional integers, output the product of those N
integers.13: Sort a string
Challenge: Given a string of printable ASCII characters (and optionally its length), sort the characters by the code points of the string. Here is a list if you're unfamiliar with them.
(..more challenges to come..)
14: Repeat indexing
Challenge: Given two integers R and I and a string S, repeat the Ith character of SR times. (K can be 0- or 1-indexed; I will use 0 here.) You may assume that index I exists for S and that R is non-negative.
Conor O'BrienConor O'Brien
$endgroup$$begingroup$Most people like GUIs.
You don't.
They say that GUI's show them pretty pictures.
Your task:
Write a program that displays said image in full 256-colour ANSI art in the terminal. Because you need to show them your leet skillz at programming, you have decided to write this as short as possible. 'That's a program?' - Some user
- Given input from stdin or the command line of an image filename, the program must output it to stdout in ANSI.
- To output a string in green (#00FF00), you can print
x1b[48;5;46mInsert text here!
wherex1b
is codepoint 27 (hex 1b). x1b[48;5;<bgcode>m
sets the colour.- At the end of each line, the colour formatting should be reset so not to make the output look ugly on terminals with a resolution higher than 80x24 set.
- To output a string in green (#00FF00), you can print
- Your program must support at least one of the following image file formats: PNG, JPG, BMP, PPM, SVG
- You may use image processing libraries to parse images.
- The output must be viewable in any terminal sized over 80x24.
- If the longest side is the x-axis, its length must be resized to 80.
- If the longest side is the y-axis, its length must be resized to 24.
- The aspect ratio of the image must be kept the same. Scale using
min(80/X,24/Y)
, rounding down - The output can be assumed to be a console that supports ANSI.
- Each character of the resized image represents 1 pixel.
- The characters printed must be a space.
- The colour for an individual pixel must be the closest available colour in the colour map (Text version in wikipedia link above).
- In this case, the similarity of 2 colours can be defined as:
((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)^0.5
where results closer to zero indicate closer similarity.
- In this case, the similarity of 2 colours can be defined as:
- If your image format supports the alpha channel, you may assume it is empty/doesn't exist.
Example
Found here is our beloved logo. This hexdump is what your program should output given that image as an input.
This is a code golf, the answer with the shortest answer in bytes wins!
BlueBlue24.2k11 gold badge1111 silver badges2222 bronze badges
$endgroup$$begingroup$Self-Golfing Code
I think it would be interesting to have a challenge to write a program where the program could 'golf' itself. The hard part is coming up with the right specification and restrictions to keep the submissions interesting. What I'm currently thinking of are the following:
- The input is the program's own source code, provided in stdin or as a file.
- The output is a 'golfed' version of the source code that must be shorter by at least 5 characters.
- If the 'golfed' version was run with the same input (the original source code), the output must be the same as the output of the original.
- If the program was run with any other program (in the same language) as the input, the output must still be syntactically valid. It does not need to shorten it, and it does not matter if the resulting program doesn't function the same way.
- If the program's source code was placed within another program (in the same language), then running the golfer on that other program would still 'golf' the embedded source code in the same way. (The idea here is to prevent something like a program that just deletes the first five characters of itself.)
- The score is the length of the original 'ungolfed' program.
Is this challenge interesting enough in a variety of languages? And what other cheap tricks need to be guarded against?
migimarumigimaru
$endgroup$$begingroup$If you're not programming functionally, then you're programmingdysfunctionally.
Long time ago, in the first ages of universe, coders and variables were living peacefully; but one day, they turned evil and then began a long war between them and men. Unfortunately men could not do much against so many variables. Only a few men are still alive today, but fortunately you can do something for them. You have heard about the ancient art of computer programming and you even spoke one day to a very old functional programmer. Your mission is to kill as many variables as you can.
This should be the first challenge in a longer series called 'Thinking functionally'.
Goal: write a short and interesting piece of code in some language where variables are usually needed (we all know that you can write some code in J or in some stack-based language with no variable, but please, choose some other language for this challenge), and use fewer variables than what would have been expected. You must explain what you did.
Rules: What has to be avoided here are mainly variables involved in keeping some information for later use (next step, next iteration, next line, etc.); this covers global or local variables, closures, etc.; if list or tuples are obviously used to replace several variables with no interesting 'trick' they should be avoided. Using complex numbers in a tricky way is ok, but using some mathematical operation with them should be preferred rather than merely using separately both parts in the number. Using bitwise trick is fine, but again, try to be clever (see example 1 below) and don't use them only with some masks for separating the data. In all cases, mathematical tricks should be preferred rather than complicated ways of inserting data in some type. On the other hand, you are allowed to use as many bound variables for writing functions as required. Your code should explicitely contain an interesting 'trick' for avoiding a variable in a place where everybody else would have used one.The most important requirement is: don't try to hide data with too much energy, rather ask yourself if data is really useful.
Example 1: Here is a first example in python, acceptable and interesting. The computer will guess which number you are thinking at with an optimal strategy, with only one variable.
Explanation: usually this game requires at least two variables, a and b, which allow the program to remember the smallest and largest possible number, then a third number is computed (a+b)/2 and a or b is updated according to the answer of the player. Here the code uses only one variable, and checks for successive bits in order to set them or not. It is obvious here that no hidden data is used, but we notice that the 'natural' way of coding this game is redundant; using two variables isn't really needed since each guess actually belongs to a single possible path.
Example 2: Here is another example, acceptable but not as much interesting. How can I swap two variables?
Explanation: everyone knows that three variables are needed for swapping two variables, and we laugh when students try something like a=b followed with b=a, but you actually can swap variables without any temporary variable.
Score: this is a popularity contest; the winner will be for the answer with the most upvotes. Vote for an answer if you find it clever and tricky.
Thomas BaruchelThomas Baruchel
$endgroup$$begingroup$This KOTH takes place on a melting iceberg. You must stay on it as long as possible, and preferrably, be the last man standing.
The field is a perfectly circular iceberg which shrinks at a unknown rate, in the center of a 2D plane. Gameplay is executed in turns on which your program will be called with the current status of the iceberg and other participants. Each turn you may either change your movement direction or push someone near you (or neither).
Movement and positioning
Positioning is in a 2D plane of floating point coordinates, and movement is a speed of x and y components. When issuing a move command, your entry will keep moving in that direction until you explicitly tell it to stop or change direction with another move command (or a push, more on this soon). The maximum move speed is 1.0 in magnitude, and if you ask to move further than that, your speed will be adjusted to conform this limit.
Pushing
Your program can issue push commands to any entity within a radius of 1 from you, resulting in you and your target having your speeds changed to point away from eachother and at a given speed. The push speed is directly adjustable, but the direction isn't. Push speed is under the same limitations as a move command, and thus can't be stronger than 1. If two people push the same target at once, the target is pushed in the resultant direction. Pushing will take into account the target's move command, if there was one.
Input
Each round, your program will be invoked from the command line, with a CSV document being passed to its STDIN. The first line of this document provides the current iceberg radius (floating point number) and the amount of remaining competitors (integer)
After this 'header', there will be one line for each remaining competitor in the following format (which is on its turn on the format
type(variable)
):Your entry will always be the first item on the list.
Example input:
(the is a trailing newline, represented like that for clarity)
Output
Your program will process the given input and output a ASV (Anything Separated Values) document. A ASV is like a CSV, except everything that doesn't match the regex
[.0-9a-z]
is considered a separator (even uppercase letters). If your program emits more than 1 line, only the last one is considered.For movement:
For pushing:
To do nothing, simply don't output anyting
Where
move
and push
are string literals.Example:
or
The following lines are valid outputs for your program:
Detailed Rules and remarks
A list of important points to consider:
- You can skip your turn by returning no output, but this will make you keep moving in the direction you ere headed to.
- If a competitor loses, it will not show up on the participants list (see below)
- A player is considered to fall from the iceberg if their distance from the center is greater than the iceberg's radius.
- Entries do not have a physical radius, so they cannot bump on eachother (except for the push command)
- You can't know the shrinking rate of the iceberg.
Scoring
A entry's score is the average
turns_survived*players/total_turns
out of 10 runs. Each run may have a indefinite (but not infinite) amount of turns, until only one competitor survives.The scores will be periodically maintained here, and 100% up-to-date at INSERT URL
The winner will be chosen at INSERT DATE
Examples in pseudocode
Antisocial - pushes everyone away from him, doesn't care about where he is.
KroltanKroltan
$endgroup$$begingroup$Meta:I am running this as a little series of challenges revolving around the topic of randomness - in the form of a 9-hole golf course. I'm maintaining a leaderboard across all challenges in the series, and offer a large bounty to the person competing in all of them with the lowest overall score.
Just to be clear, despite the name, I won't be posting these once a day. Expect the next one in 6 to 8 weeks.
This will be a series of 9 challenges. See the first instalment for more information about the series.
- Poisson disc sampling: This is a method to randomly distribute points across the plane densely while maintaining a minimum distance between points. I think this might be nice to golf. Further reading.
- Generate a random chessboard: The submissions should randomly produce a believable chessboard. 'Believable' here mostly affects pawns: they may not appear on the first row of their colour, there may be more pieces of other types if pawns are missing (due to conversion), and two pawns may only be in the same column if at least one of the opponent's pieces is missing. Submissions should be able to generate any valid board with finite probability, but it doesn't have to be uniform.
- Generate a random arithmetic expression: This basically asks to create a tree of binary and unary operators, subject to some constraint - either on the structure of the tree (
n
nodes, say) or on the result of the arithmetic expression (generate a random expression that evaluates to a givenn
). - Generate a random hole-free polyomino (or orthogonal polygon) (of given size).
- Vague idea: Generate points on a sphere with uniform distribution.
- Vague idea: I'd like to include a challenge on random walks.
- Vague idea: I'd like to include a challenge which has to generate a random number with a constraint based on its digits, but where you're not allowed to use strings or arrays (so you have to access the digits arithmetically).
- Idea I'm not sure about: Generate a valid Unicode character as a set of UTF-8 bytes with uniform randomness.
- Idea: Implement a (specific) PRNG.
- Idea: Generate a random Brainfuck program (or other balanced string). Would probably need to require uniform distribution and deterministic runtime to be interesting.
170k99 gold badges161161 silver badges274274 bronze badges
$endgroup$$begingroup$What are holidays without music boxes?
Your task is to implement a digital music box. Your program will be given a reel of music such as follows:
Now, your program must play the music, which is straightforward. In this example, one line is read every 1/2 second. If a line contains one or more
O
characters, those notes are played simultaneously to form a chord. The range of the music box is a Concert C scale from Middle C (C4) on the left to High C (C6) on the right.
When a chord is played, the sounds of all previous chords are stopped. If a line does not contain any notes, then the previous chord is sustained at reduced volume.
Input
Input will be several lines of text. Your program should read and follow the directions line-by-line.
If a line contains
### lines per minute
then each following line of music should be played at that tempo. There may be more than one tempo change in the piece, and your program should be able to change tempos. The tempo change itself does not take up any time. There will always be a tempo mark before any music lines.If a line contains music (15 characters long, all characters either
.
or O
), then those notes should be played and sustained for the correct duration (given by the tempo).If a line does not fall into either of the above categories (like
Music from..
and CDEFG..
in the above example), then it should be ignored completely. The program should act as if they weren't there, simply skip over them with no pause.Output
Output could either be sound from the speakers, or a playable .MP3 or .WAV music file.
Should this be code golf? I assume so, although I want an added bonus for improved sound quality. It's probably not going to be possible to enforce sound quality requirements.
Are there any other things to add? Or, is this pretty much ready to go?
PhiNotPiPhiNotPi19.9k11 gold badge3232 silver badges4444 bronze badges
$endgroup$$begingroup$
Given an ASCII string of spaces,
o
s, and O
s, balance them on a see-saw pinned at the center, and determine which way it tilts.For example,
ooO O
represents the situation:A lowercase
o
has a mass of 1kg, and an uppercase O
has a mass of 2kg. The torque of a weight is its mass multiplied by its distance from the center of the see-saw. If the sum of the torques on the right of the see-saw is greater, the see-saw will tilt clockwise. If the sum of the torques on the left is greater, it will tilt counterclockwise.In the situation above, the total clockwise torque is
2 * 2 = 4
, which is greater than the total counter-clockwise torque, 1 * 2 + 1 * 1 = 3
. So the see-saw tilts clockwise.You may choose two fixed output values — one for “clockwise” and one for “counterclockwise”. Your program must consistently output these values for their respective situations.
The input is a string of odd length 3 ≤ n ≤ 255, and it is guaranteed to never be in perfect equilibrium.
LynnLynn
$endgroup$$begingroup$This challenge was inspired by this question on math.SE by @Karl
You might be familiar with the Ulam spiral. What we're doing here is similar, but a little bit different, given a positive integer
N
we generate an image: On an empty equally spaced rectangular 2d grid choose an arbitrary point and place a 1 then place a 2 on the grid point to the right of the 1. Then continue as follows:
If you're at number
n<N
:- If
n
is composite: Go straight in the same direction to placen+1
- If
n
is prime: Turn right to placen+1
(overwrite, if there was another from a previous step) - Repeat this for
n:=n+1
.
Now consider the grid as a pixel image that is plain white. Then colour each pixel where we placed a number on the corresponding grid point. Then choose a finite rectangle that contains all the coloured pixels, and output it as an image.
Examples
For
N=10^5
we get following output (by@Wojowu)Community♦
flawrflawr
$endgroup$$begingroup$This is an idea for a question, and is very much unfinished. Please help me develop it further.
To date I've simplified my pate. The terrine is removed with the meat's temperature reaches 155F around 1.5 to 2.5 hours later, depending on the level where the terrine has been placed (top, middle or bottom). Either Jack or Wild Turkey can be substituted for cognac should you wanna' crow!And don't forget to line the terrine with fat back.Should any vegetables be included, then they need to be precooked in order to bring out their best flavor, especially onions which should be carmelized for around three hours beforehand (and their volume will reduce bigtime).For a 100% liver-free pork pate, it's place into a 160F water bath into a preheated 300F oven. 60-70% lean boston butt30-40% fat backA spoonfull of lard, some extract of pigs feet for aspic, and the usual herbs and spices. The meat marinated in those seasonings, cognac and white wine the day before. Time life cookbooks for sale.
This is inspired by an evolution simulation I coded a few years ago in JavaScript. The source code and documentation can be found on GitHub, and you can play the simulation itself here.
This will be a popularity-contest. I'll provide a specification which all answers must keep to and a few ideas for features, but otherwise add as many features as you can.
Summary
Your task is to build a simulation which demonstrates evolution by natural selection ('survival of the fittest'). The world in which this will be carried out will be a two-dimensional, n by n (exact dimensions to be decided) grid. Each cell on the grid can be empty or occupied by a living cell (or by food resources?).
Cell lifetime
Cells have a 'lifetime counter', which starts at some value when the cell is born and diminishes randomly over cycles of the simulation, so the cells age. It can be replenished by food, but when it reaches 0, the cell dies and is removed (or converted to a food block).
Cells instantly die when completely surrounded? Is that a good idea?
Genetics
Every so often, cells replicate - produce a copy of themselves, with the lifetime counter reset to maximum, normally with identical characteristics.
There is a probability p (to be decided) that when a cell is replicating, its genome will be changed. It can 'improve' or get 'worse' with equal probability.
The genome can be as simple as an array of true/false booleans for different characteristics, or an array of integers/decimals describing how much of a characteristic there is (e.g. replication per 100 ticks).
Characteristics which could be included are:
- faster replication
- eating other cells to increase lifetime counter
- movement
The Simulation
The simulation starts with a single, very basic cell, with no fancy characteristics, placed at the centre of the grid. If we decide to implement food resources for cells to pick up, some of these will spawn as well.
Every cycle, cells replicate, age, and die as described above.
user16402
$endgroup$$begingroup$The goal is to make an algorithm that plays as low score in 2048 as possible.
Rules
- Your AI will play the game of 2048 repeatedly.
- If a game takes more than 2s or scores more than 5000, it will be terminated and score 5000 will be used.
- If a game gets to
Game Over
, the final score will be used. - The quality of the algorithm will be the average score of the separate games.
- After 4 weeks, the winner will be chosen. However, if another algorithm is proposed, I will test it and change the winner if necessary.
Choosing the winner
- Each algorithm will be run 1000 times.
- The best 10 algorithms will be run again 10000 times to precise the quality.
- If the score of the two best algorithms is closer than 3% from each other, they will be run 20000 more times. If they are closer than 3% after this, both will be named as winners.
Algorithm specification
C++
- An example code is in files 2048-core.cpp and rand.cpp.
- Your code should follow the example of that file: a function
int NextStep(const Game&)
should be provided.
Other languages
- I surely work with Python, I should be able to run Java. For other languages, provide a short code together with a way how to compile it, so that I can see what can be done.
- Provide a program code that accepts the following input:So a typical output line is:And outputs one number for the next step:
0=UP
,1=RIGHT
,2=DOWN
,3=LEFT
. - For linking your script to the interpreter:
- Download 2048-core.inc, 2048-pipe.sh and io.cpp
- Compile
2048-io
byg++ -O3 -o 2048-io io.cpp
- Run
./2048-pipe.sh ./yourprogram
, this should work well.
My PC specification
- Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz, 4GB RAM
- Fedora linux 3.14.4-200.fc20.x86_64
- gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
- (Anyways, I believe that providing 2 seconds per run is more than generous and should be fine. If more people complain they would use more time, I can extend it.)
- How to make it available to Windows other than C++?
- Proper tagging.
yo'yo'
$endgroup$$begingroup$I'm just giving this a 'code bots' title because that's the most similar previous KOTH. This version is based on the Twin Tin Bots board game, and will probably be given a better name before posting.
On a far away planet, dozens of small mining robots compete for resources in the form of tiny crystals. Each individual bot is quite simple in its programming: given a series of steps, they can attempt to follow it. These bots, however, are remotely programmable, as their programming can be slowly edited over time to respond to current conditions. In this challenge, you will write a program to program these bots.
The Game Field
The playing field is a toroidal grid, with each cell containing either nothing (
.
), a robot ('>'), a crystal (=
), or a base ('@').Robot Programming
Each robot contains a program, which is a series of basic steps that the robot can perform. The program is always 24 commands long.
HALT
(H
) - If a robot executes this during its turn, its turn is immediately over. The entire program is initially filled withHALT
s.MOVE_FORWARD
(FORWARD
/F
) - The robot who executes this command will move forward 1 square if possible, pushing up to one other robot/crystal.TURN_RIGHT
(RIGHT
/R
) - The robot will rotate clockwise by 90 degrees.TURN_LEFT
(LEFT
/L
) - The robot will rotate counterclockwise by 90 degrees.GRAB
(G
) - The robot will pick up a crystal if there is one directly in front of it. Also, if there is instead a second bot directly in front, this will steal a crystal from that bot's inventory.DROP
(D
) - The robot will take a crystal from its inventory and drop it, if possible. If there is an empty space in front, the crystal would fill that space. If there is instead a robot in front, then the crystal is added to that bot's inventory.ZAP
(Z
) - This is an interesting command, and it deviates slightly from the original game. A zap command allows one bot to issue a command to a second bot positioned in front of it. If bot_X is directly facing bot_Y, and bot_Y is within a distance of two, then bot_X can zap bot_Y. The very next token in bot_X's program will then be executed by bot_Y instead.ZAP
commands have a range of 2, meaning that the zap can travel across a single empty square to reach a target which is not immediately adjacent to the zapper.- The
ZAP
command can be stacked:Z,Z,F
causes the bot in front of the bot in front of this bot to move forward. - An example: The program
L,F
normally causes the current bot to turn left then move forward. The programZ,L,F
causes another bot to turn left, and then the current bot to move forward.
JUMP
(J
) - This serves as an unconditional jump in the program, a feature not found in the board game. This causes the program execution to jump forwards to the location immediately after the next HALT. For example,F,J,R,H,L
causes the bot to move forward and then turn left. TheR,H
is skipped over.- A program with a
JUMP
ed section acts exactly like a program with that section removed. So,F,J,R,H,L
acts exactly likeF,L
, andZ,J,H,D
acts exactly likeZ,D
. JUMP
can be used to easily switch between multiple complex behaviors. For example,F,F,H,R,R
can easily be edited to formJ,F,F,H,R,R
.
- A program with a
Notes:
- The steps
ZAP,HALT
will not have any effect. The bot performing the halt wouldn't be the current bot, since the zap causes the halt to be performed by the bot directly in front (if any). TheHALT
command only has an effect if it is executed by the bot whose turn it currently is. - The steps
ZAP,ZAP,HALT
might have an effect. If two bots are facing each other, then the HALT would be executed by the original bot, ending the turn. If the bots aren't facing each other, then the HALT would be executed by a third bot (or nobody at all), having no effect. - In the original game, the zap command allows the zapping player to perform 'special action' on his turn that affects the target bot (the player, instead of the bot programming, determines what the zap does). Here, the action of zaps are determined by the bot program.
Editing the programming
Each turn, the bot's programming can be altered. Any number of commands can be removed (shifting the following commands to the left and adding a
HALT
to the end). Only one command, however, can be inserted each turn (shifting the following commands to the right and deleting the last one).Game Objective
Your goal is to navigate your bot to pick up crystals and return them to a base (they serve as collection points). Each crystal you successfully
DROP
off at a base earns you one point. Each bot can only carry one crystal at a time. These crystals can be acquired by GRAB
bing them off the ground or by GRAB
bing from an opponent bot.Execution Order
The players take turns in a cycle. On your turn, your program will receive the current game map (as an object) and your current bot's program. Your program can then submit the edited bot-program. Your bot's program is then immediately executed, affecting the board before the next player's turn begins.
More spec coming later.. The controller is currently under construction.
PhiNotPiPhiNotPi19.9k11 gold badge3232 silver badges4444 bronze badges
$endgroup$$begingroup$Also if you make overhanded a thing I'll whack everyone involved with a large trout ~ Doorknob
You and your poker buddy are bored, and seeking to liven up the usual poker game. Playing one hand just isn't challenging any more, and you're looking to add a bit of depth. So, why not play with two?
Overview
This is a round robin tournament of two-player poker. For each round, a player will need to make two hands of five cards each. To do this, each player will be dealt seven cards, with three community cards to fill out the hands. After receiving their seven cards, players will be allowed to exchange any number of them for new cards from the deck one time.
Once each player has exchanged cards, they will split the ten cards (7 in hand, 3 community) into two hands, Over and Under. The object for the Over hand is the highest ranked hand, while the object for Under is lowest.
Scoring
In each round, a player will receive one point if:
- Their Over hand is higher than the opponent's Over hand and
- Their Under hand is lower than their opponent's Under hand
If one hand wins (Over beats Over or Under loses to Under) and the other ties, you get half a point.
If one player wins one and the other wins the other or both hands tie, no points are awarded.
Rules
- Standard poker hand rankings apply (link chart or something here)
- Play fair! (will expand on this with the usual KotH stuff)
Controller
King Of The Hill Roger Mcguinn Covers
WIP
Meta
Obviously this needs some more work. Initial thoughts, questions?
GeobitsGeobits
$endgroup$$begingroup$Number-Hopper Maze
Write a program that solves the Number-Hopper maze described above. The input will be an ASCII art description of the maze
-
and+
are walls, they are interchangeablex
is the starting pointo
(lowercase O) is the destination
The numbers are hop points, to hop from number A to B, you must pay the cost of
abs(A - B)
, the positive difference between two numbers. The goal is to find the solution with the minimum cost.The solution for the example above is
x-13-11-9-8-29-28-o
, with total cost of 4.The input of the program will be the ASCII art of the maze, and the output is the sequence of numbers to hop, with the total cost. In the format of
x-13-11-9-8-29-28-o 4
To qualify, you algorithm must be under or equal to
O(n^2)
. Include an informal proof if others suspect you.I don't want to see pure brute-force solutions where obvious bad solutions such as moving in loops and making total 99999-steps for a small maze are included in the solution space.
The shortest code wins.
Community♦
Ming-TangMing-Tang
$endgroup$$begingroup$The specification is now complete; the control program will now be written
Your task is to create an AI which builds a profitable transport network to carry passengers. In each game, the first entry to have $262,144 or more in cash wins!
Every entry must have a name and version numbering for each time it is altered. You may submit up to 8 entries, but they must not collaborate.
Control
Each round has four players. Each player has a number from 1 to 4.
A simple map will be randomly generated by the control program for each game. This map will be stored in a file
map.txt
two directories above your program (i.e. ././map.txt
), and updated each game tick. Each player's bank balance (as a number without the $ symbol) will be in ././account_<PLAYERNUMBER>.txt
. Vehicle data will be in ././vehicles_<PLAYERNUMBER>.txt
. You may view other player's vehicle and account files.Your program will be invoked once, at the start of the game. When your program has finished initializing, it must output
READY
. If it takes more than 60 seconds to initialize, it will be terminated and disqualified from that game. It may keep files between rounds (for example, to predict an opponent's strategy after watching them for a few games). Other players may not view these files. The tournament will be re-run and the leaderboard updated every 2 days. Your program may not keep files between tournaments.The control program will put the text
WAITING-player_number
(e.g. WAITING-4
) and a newline to your program's standard input when each game tick begins. You will submit actions on standard output, separated by new lines, terminated by END
. Actions that are invalid for whatever reason will be completely ignored. If your program takes longer than 1 second to output END
, it will receive TIMEOUT
on standard input and no action will be executed for this turn.If no winner has been found after 30 minutes, the player with the most money wins.
Map format
The map will be a two-dimensional ASCII grid where the top is north, the bottom is south, the left is west and the right is east. Example:
#
represents a road. /
represents empty land. *
is for difficult terrain (e.g. hills, swamps, whatever) - more on that later. @
represents a house. ~
is a body of water. +
is a completed bridge over water. |
is a partially constructed bridge. The numbers 1 to 4 represent stations belonging to players (e.g.: if you are player 4, your stations will be marked as 4
). 5 to 8 represent 'inactive' stations belonging to players 1 to 4 respectively.The line endings in the file will be Windows-style CRLF.
The top left corner is
(0,0)
. X is horizontal and Y is vertical.Construction
Each tick, a player can perform up to 4 construction actions. These are:
- replace a
/
with a#
(build a road) - replace a
*
with a/
(prepare terrain) - replace a
#
with an inactive station (build a station) - replace a
~
with a|
(start a bridge) - replace a
|
with a+
(finish a bridge) - replace one of your stations with a
#
(demolish a station)
You may not perform more than one action on a tile in one turn (you cannot go from
~
to |
and to +
in a single turn).You cannot demolish roads, bridges, water, houses or other players' stations.
Each action costs $512, and is sent to the control program on standard output in the following format (B is for Build):
For example, this will build a road at (8,4):
Invalid commands will be ignored.
Vehicles
Each player can own an unlimited number of vehicles. The basic bus has the following properties:
- carries 32 passengers
- travels 8 tiles per turn
- consumes $8 per tile in running costs
Each vehicle can have up to 4 upgrades out of the following (but no more than 2 of each type):
- +16 capacity (denoted by
C
) - +4 tiles/tick speed (
S
) - -$2 running costs (
R
)
At most one vehicle can be bought by each player per turn. The basic bus costs $4096 and each upgrade costs $1024; the maximum possible cost is therefore $8192 (all 4 upgrades). A bus can be sold at any time for half of its purchase price (including upgrades; a bus with 4 upgrades can be bought for $8192 and sold for $4096). At most one vehicle can be sold each turn.
The command for purchasing a vehicle is (P is for Purchase):
For example, this will buy a bus with no upgrades, assign it the ID 5, and place it at (7,7):
The command for selling a vehicle is simply (V is for Vend)
Vehicles are stored in
vehicles_N.txt
in the following format, separated by newlines:For example, this bus has ID 4, is at (5,5), contains 15 passengers, has two speed upgrades and one running cost upgrade, and last stopped at (3,4). If the bus has never run
A
before, use the coordinates where it was created for the 'last station' coordinates. Update the coordinates every time A
is run for that bus.Vehicles can travel on roads (
#
), bridges (+
) and station tiles (12345678
). In the above example, it is possible to drive from the top left corner to the bottom right corner. However, the two road sections in the map below aren't connected, because they are only diagonally touching. Building a road on one of the *
would solve this.Vehicles can only stop to pick up and drop off passengers at stations belonging to their owner - player 3's bus can only stop at a
3
or a 7
, but not at any of 124568#+
.Your AI has complete control over the movement of its buses. It will submit directions as commands. For example, the following command set will move bus 8 in a circle, then two spaces south, then make it offload 8 passengers, then make it wait for passengers (N, E, S and W are north, east, south and west; R is for Remove; A is for Acquire):
NB: Waiting at a station with
A
counts towards the limit of tiles that the bus can travel each turn, although it is not moving. While waiting, double running costs are charged. A bus may wait for multiple turns. If a bus moves fewer tiles than it is able to (e.g. can move 8 tiles per turn but chooses to move 5 times), halved running costs are charged for the unused turns.Passengers
Each time an
R
command is submitted for a bus that is at a station, the bus loses 8 of its passengers. The diagonal distance (using Pythagoras' theorem) between its current station and the previous one is calculated and rounded down (floored). Each passenger offloaded gives this amount of profits (e.g. if the previous station is 1.4 tiles away, each passenger gives $1; if it is 5.9 tiles away, each passenger gives $5).Each time an
A
command is submitted for a bus that is at a station, the bus gains passengers. Each house in range of your station provides 1/number_of_active_stations_in_range_of_house
passengers.If there are three stops, A, B and C, and the bus has a route from A to B and then to C, but only picks up passengers at A, then passengers offloaded at B will pay the price for A to B, and passengers offloaded at C will pay for A to C. However, if any passengers are loaded at B, then all of the passengers offloaded at C, even if some of them boarded at A, will pay the fare for B to C.
In the map below, the tiles marked with
@
and #
are in range (4 tiles or less away), but not the tiles marked with /
; the bus at 1 will gain 32 passengers because there are 32 houses in range and no other stations.Other
You will be charged $64 per turn for each station, active or not, that you own.
Each turn, active stations have a 1 in 8 chance of becoming inactive. This is reverted when a bus runs
A
at the station.You will start with $32768.
You may not have a negative quantity of money.
When someone wins, all competing programs will receive
GAMEEND
on standard input. They may no longer submit commands after this happens, but they may read and write from files (to prepare for a subsequent game, for example). After 60 seconds, all competing programs will be killed.The map will be 256*256 tiles.
Todo
- Write control program
- Write map generator
- Plan tournament format
user16402
$endgroup$$begingroup$Congratulations! You have been selected as the chairman of your state's redistricting commission. It is your job to propose a division of the state into electoral districts. Your true goal, however, is to make sure that your party wins. To avoid suspicion, your divisions should appear as innocuous as possible while still giving your party an edge.
The map will be provided as a grid of
0
s and 1
s. The 1
s represent your party. Below is a simple example map:You are also given a number which represents the number of electoral districts that must be created. Continuing with the example,
4
will be the number for now.A division of the map is a partition into N number of contiguous regions. If
P
is the total population (number of digits), each district must contain at least floor(P/N)
people (digits). A division can be represented by a new map, with each district labeled by a unique (non-whitespace, printable) ASCII character. The following represents a division into four segments:A map has been successfully gerrymandered if the number of districts with a
1
majority is greater than the number of districts with a 0
majority. In the above division, districts a
and b
have a 0
majority, while districts c
and d
have a 1
majority.Here is an alternative division in which gerrymandering was successful.
District
a
has a 0
majority, while districts b
, c
, and d
have a 1
majority. This means that the 1
party has a clear majority in the election.The Distortion Metric
There are many ways to gerrymander a map, but you want to make sure that your method passes a visual inspection. Thus, the shapes should appear as regular as possible. One method for measuring this is by summing up the perimeters of each district. The lower the total perimeter, the more disguised the gerrymandering.
Both divisions above have a total perimeter of 32 (each district has a perimeter of 8). On a 3x4 map, this is as good as you can get. Below is a map with a total perimeter of 16 + 22 + 20 + 16 + 22 = 96.
The Goal
The goal is to write the shortest program which, hen given a map of
0
s and 1
and a number N, outputs a gerrymandered division of the map into N districts with the lowest possible total perimeter.More detail coming soon
PhiNotPiPhiNotPi19.9k11 gold badge3232 silver badges4444 bronze badges
$endgroup$$begingroup$The Rules
- The field is a 5N by 5N grid, where N is the number of players.
- The controller places each player's ships randomly.
- Each player can see their ships and the shots they have made, successful or not. Each player can also see other players' successful shots.
- Each player gets one shot per turn.
- Each player's fleet consists of, for a total of 21 squares altogether
- 1 aircraft carrier - 5 squares
- 1 battleship - 4 squares
- 2 destroyers - 3 squares
- 3 assault boats - 2 squares
- You are allowed to keep state information between turns, but not between rounds/games.
The Specs
Input
Input will consist of one integer and a list of lists, space-separated, like so:
3 [[S, X, .],[S, O, M],[S, ., H]]
. This corresponds to the following grid:These are the meanings of the characters:
.
Unknown (i.e., it's empty or no one has attacked there yet)O
A piece of your ship that has not been hitX
A piece of your ship that has been hitM
One of your missed attacksH
A hit from another playerS
A ship that has been sunk, either yours or an enemy's
Output
Output must be a pair of integers in the format
x y
.Meta
- Adjustments to the fleet?
- More details needed in the spec or rules?
El'endia StarmanEl'endia Starman
$endgroup$$begingroup$Given the following input:
- A number consisting of decimal digits, the
guess
- A number consisting of decimal digits, the
answer
You are to output a single natural number, the
base
, such that when you interpret the guess
as a number in the base base
, the distance between guess
and answer
is smaller than for any other choice of base
. To be clear,
answer
is interpreted as base 10guess
is interpreted as basebase
- distance means absolute value
- The
base
must be greater than the largest digit used. I.e. if6
appears in theguess
, you cannot output a base smaller than7
because any base smaller than 7 does not use the symbol6
.
Motivation and Example
Your friend asks you a question like 'What's the population of New York City?'
You have no clue, so you make a guess '1,400,000 people', you say.
He says 'You're an idiot, the population is 8,550,405. You were so far off.'
You then do some quick math in your head and say, 'I wasn't that far off, I didn't realize you wanted base 10. I was using base 14. In base 10, I said 9,680,832, which wasn't that bad of a guess'
In this example
Test cases
Eventually maybe.
LiamLiam
$endgroup$$begingroup$I have an ASCII grid of size 10x10
Occasionally, slashes and Xs pop up, but they're too small for me to see!
I need a program that can extend them so that I know where they are Train mechanic simulator 2019 free download.
Your task is to create a function or a program that can take in a String of a grid lines separated by
n
and outputs grid lines separated by n
(optionally including a trailing newline). When there is a
or a /
, your program must add slashes diagonally until you reach both ends so that the slashes look like a line. Whenever two lines intersect, you must replace them with X
. If given an X
, you must extend in both diagonal directions. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.These test cases do not contain a trailing newline, due to limitations, however you should add them when testing.
Test for overlap
Test for Xs
Test for X and avoiding
Test for slashes in the same row
Test for lots of lines
Test for empty grid
This is code-golf, so the code with the shortest number of bytes wins!
Nathan WoodNathan Wood
$endgroup$$begingroup$This would be representative of the classic Snake video game, but multiplayer. The game would be 2-4 players.
Game Description:
Each of the 2-4 snakes will always start at one of four fixed position on the board. Each snake continuously moves forwards at a constant rate. A snake stops moving upon death. The board wraps in both directions, but would be graphically represented as a grid (plane) in an actual game with people, so think of it as 'snakes on a plane' if you wish. The dimensions of the grid are TBD.
Apples and poison apples (referred to as Blues and Reds) will spawn in random locations on the board, either at a random rate, or only to replace one as it's consumed (TBD). An blue increases your snake's length by 3. A red reduces your snake's length by 2 (to a minimum of 2). Both are useful in managing your snake's length.
A snake's length will increase by n by the tail not moving for n turns. A snake's length will decrease by n by the tail moving an extra space for n turns. Eating one blue followed immediately by one red should hold the tail for 1 turn, then continue as normal (they cancel).
Your snake will die if its head collides with its body or the head or body of another snake, whether alive or dead. So a head-on collision means both snakes die.
Your Bot's Job:
You will create a bot to play this game by submitting which of the 3 directions to move (turn left, straight, turn right) based on information including:
- The game's grid as a 2D array
- Each snake's current length
- An ordered list of your snake's tiles and orientation
- An ordered list of each enemy snake's tiles and orientation, and whether the snake is dead or alive.
- The location of every apple on the board
- The location of every poison apple on the board
- Each player's numbers of wins, kills, and deaths.
You will likely be creating class that is an instance of a base class
Snake
, and implementing the necessary methods. If a move is not returned in the appropriate time-frame, your snake will move straight.The Winner:
Each snake will be pitted against each other snake multiple times. The one which has the highest score after the most games wins. Scoring TBD, but will likely be something like +100 per win, +10 per death on your snake (someone ran into you), -10 per death. Tied games will be possible, since there will be allowed a short period of time while the last snake is alone on the map, in case it would die soon after winning.
Suggestions?
Suggestions for scoring are welcome. Besides winning, how should apples/length/kills be factored in? Personally, I was thinking most wins, followed by most kills, but I can see that might encourage some people to stay small and avoid everything. Some options (feel free to suggest more):
- Prioritize wins, then kills
- Weighted or point-based scoring for wins, kills, apples
- Just score by length at end of match (so maybe after eliminating the others you could just grow until your bot dies)
- Collect points by being the longest snake every tick
Bots must inherit the
Player
class, implementing the choose_direction()
function.I'm considering making it so that each snake must pick the next three moves at the same time. I'm not sure if this is necessary, but this would make it more like playing like a person, where you can't always react in time. This would keep the games from going super long if no snake would otherwise run into another one. It would also allow for shenanigans, like zipping in front of another snake to kill it.
Another cool idea would be to have the bots make choices asynchronously as the game progresses, the same way human players do. If you don't choose a direction during a tick, you go straight. This way, you could also take extra time to calculate a move by choosing to return a move less often.
This is based directly off of a game I've played, which I think is called either 'Worm ed 2' (as in Worm: edition 2) or 'Wormed 2'. I was unable to find the game in a short search. The game is likely old, and I don't know where it could be found online if at all. If anyone knows of it, please comment!
mbomb007mbomb007
$endgroup$$begingroup$This is an idea I have been working on in conjuction with users @Trimsty and @githubphagocyte in the chat room. It is inspired by the flash game 'Bubble Tanks' by Armor Games.
This will be a king-of-the-hill challenge.
Main Idea
The main idea is that a large number of competitors fight each other in a large arena. Each program is the AI of a different tank. These tanks are customizable from a list of available parts which can be purchased, so the competitors can choose how to upgrade their tank as the battle progresses and they earn points.
The Arena:
The arena may be an almost-infinite plane with a light source near the center. Tanks can travel far away, but lose energy away from the light. This is a continuous-space game, so the tanks have locations/directions determined by floating-point numbers.
The Bots:
The tanks are basically circles, with the center point of the tank being the location. There is no collision detection, except that projectiles inside of another tank's radius are considered hits. The tank's size (radius) will be determined by the different upgrades it has, with larger weapons giving more size.
Bots will also have a health level which reduces upon injury from opponent's weapons. The health will start at some number, and the bot dies upon the health reaching zero. As bots kill others and collect points, health can be restored over time.
If a tank goes too long without making progress (collecting points or killing), then it will begin to rust. Rust will slowly damage the tank and kill it. Rust can be eliminated by making progress.
Weapons also need time to recharge, and this time is dependent upon rust and other factors.
The tanks are solar-powered. The farther the tank goes from the light source, the slower it can move, the longer it takes for the weapons to recharge, and the shorter its range-of-visions is.
Bot vision:
A tank's vision range will be determined by the light level. If an object is located in a high-light area, then it can be seen from farther away. An object in a low-light area can only be seen by nearby observers. A tank will be able to see things which are closer than the light level in that object's location. The bot will be able to see other tanks, as well as other features (bullets in-flight, heat-seekers, maybe mines). The information available about other tanks will be that tank's weapons (maybe).
Winning criterion:
Each match will be one single battle-to-the-death involving all of the tanks. The tanks' scores will be the time until death.
It might be that several matches are held with the winner being the contestant with the highest average (or median?) score.
Upgrade system:
Each tank starts with a certain number of skill points (4000) and a certain kill value (10). The tank can spend skill points on upgrades to the various weapons. Once a bot spends points on an upgrade, the transaction cannot be reversed.
When a tank kills another, the victor's own kill value is increase. The killed bot drops skill points on the area which can be collected by nearby bots. The kill value of a bot determines (in part) how many skill points will be dropped upon that bot's death.
Types of weapons:
- Guns of various ranges, strengths, and reload rates
- Lasers
- Mines (proximity and timed)
- Area-effect (damages nearby bots)
- Heat-seekers (costly and very accurate, but short range and low damage)
- Shields (not a weapon, but a form of protection that comes in different strengths)
Additional Notes:
There may be different feature which can be added, such as:- flashlights which enable bots to see farther in the dark zones.- self-destruct, which scatters the dropped points across a broader area.- leech-weapons which steal health- speed boosts or reductions
Misc.
Some sample code provided by trimsty about skill points and kill values:
PhiNotPiPhiNotPi19.9k11 gold badge3232 silver badges4444 bronze badges
$endgroup$$begingroup$Division with numbers is great:
6 / 3 = 2
, but have you ever wanted to divide strings? In this challenge you will, given two strings (s
and t
) divide s
by t
Challenge
Given a string,
s
, find the substring in which t
is repeated the most times (non-overlapping), return the amount of times t
is repeated, example:Seems easy enough? Well if the substring ends with the first
m
characters of t
, you should add what fraction of the string t
was in the substring (m/t.len
):Rules
- You only need to output to the precision your language supports. The minimum precision is two decimal places.
Examples
First line is
DowngoatDowngoats
, second line is m
, last line is output. Examples are double-newline seperatedKing Of The Hill Reboot
21.9k22 gold badges2626 silver badges3838 bronze badges
$endgroup$12345…82 next
You must log in to answer this question.
Not the answer you're looking for? Browse other questions tagged discussionfeaturedsandbox .
Let's face it love it or hate it WoW is the king of the hill when it comes to MMO's they make the most $$ have the most players by far. By every means it's the game to beat when it comes to MMOs.
My question is what game do you feel has a chance of knocking WoW off the top of the hill to become the new King?
My research (which isn't much) makes me come to this conclusion that there is no game to date that can knock WoW off and become the new king. I don't think there is anything in development that would be able to do so either.
There is one game that may put a dent into the shiny purple armor of the WoW Juggernaut and that is Warhammer but I only see a slight dent or maybe a few dings in the armor.
Another possibility is for an eastern mmo to become extremely popular on the western front perhaps Lineage 2? Although again i don't see much more then a dent in that toony shiny epic breastplate of the Death knight known as WoW. It seems to me west and east gamers differ greatly when it comes to MMO structure and playing. It also seems that more eastern players are more acceptable to crossing over to the western front then the other way around.
With all due respect to my eastern gamer bros i do think the Korean gamers are the most geeky dedicated hardcore gamers on the planet.
So what's your opinion, suggestions and/or questions about this topic?
thx
H1Z1 King of the Kill PC Download is Ready!
H1Z1 King of the Kill is a shooting game PvP MMO with elements of survival that takes place in the reality of a zombie epidemic. The game was released for PC Windows and developed by a team of Daybreak Game Company, the production is one of the two alternative versions of survivalowego Sandbox formerly known as H1Z1, who for more than a year dystrybudowany was on Steam within the beta and gained at that time a large group of fans
During the subsequent update of introducing to the game, for example, mode of PvP competition called Battle Royale, developers have seen a marked divide the players into two groups, gustjące in two separate aspects of the game. Eventually the game designers decided to share the final product of two independent game developed by separate teams of developers. The second version of the game which, unlike the H1Z1: Just Survive – focused Siena aspect of exploratory and survival that is the same as the beta version of the game H1Z1 game H1Z1 King of the Kill PC Download focuses more on action and pure competition players, supplemented by some elements of survival.
H1Z1 King of the Kill PC Download has been set in the world of well-known from the previous version H1Z1, in an unspecified town in the United States and its extensive borders. The story begins several years after the detection of the title of the virus, which turned most of the population into bloodthirsty zombies.
It is these resources are also the main reason for the never-ending rivalry between players. Gameplay mechanic H1Z1 King of the Kill PC Download quite different from the original version of the game, so we have to deal with maintained in a similar climate MMO, which, however, unlike the original does not focus on exploratory, search for resources and cooperation of players in the confrontation with the hosts The game puts so special emphasis on a much faster and more dynamic action and player rivalries in one of several modes PVP.
Minimum system requirements for H1Z1 King of the Kill:
CPU: | Intel CPU: Core i5-760 2.8GHz AMD CPU: FX-4130 |
King Of The Hill Roger Mcguinn
OS: | Win 7 32/64bit |
RAM: | 3 GB |
Video Card: | GeForce GTX 275 Ti or Radeon HD 4890 |
Sound Card: | Yes |
Disk Space: | 20 GB |
How to download and install the game H1Z1 King of the Kill:
- Download PC Installer.rar by clicking the button below.
- Extract the .rar file to your desktop using WinRar.
- Run Installer.exe and click the Download button.
- Follow the instructions to download and download the game.
- Install the game according to the instructions.
- Click on the Settings button and adjust the language settings of the game.