Programming Wars [Round 8]

For all your silly time-killing forum games.

Moderators: jestingrabbit, Moderators General, Prelates

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Programming Wars [Round 8]

Postby Snark » Mon Jul 01, 2013 4:50 pm UTC

This is a game where a judge tells the players to create code to fulfill a specific purpose, grades the entries, then picks a winner! The winner becomes the new judge. Or we could just take turns being judge. I've thought of some interesting problems to get us started such as
  • The judge creates a maze generator, and the contestants create a program to find the shortest route from start to finish.
  • The judge invents a simplified version of chess, and the contestants create programs that play the chess variant against the other contestant's programs.
  • The judge wants a program that can automatically generate a children's story given a few random keywords, and the contestants find ways to do that.
Rule 1: All code must be written in a language that is free to legally download and able to be run from most computers.
Rule 2: I can't think of any more necessary rules.

Players:
Spoiler:
Snark, Prefers Python, Other: C
Dason, Prefers R, Other: Python, C, Java
orangedragonfire, Prefers Java, Python
bluebambue, Prefers C, Java, Other: Python
Xenomortis, C++, C#, VB.NET
cjquines, Python
benneh, Prefers Haskell, Other: C, C++, Brainfuck
Volcano99, Python, C/C++, Java
Eomund, Python, Java, C++, PHP, Javascript and a little bit of C#
phillip1882
Xantix, C#, Java, Python, C, C++
operator[], C++, JavaScript, Python, Java
Diemo - Prefers FORTRAN, Other: C, Python, Java
Jplus

Round winners:
Spoiler:
Round 1 - Skyscraper solver - operator[] - Judge post
Round 2 - "Maze" generator - benneh - Judge post
Round 3 - Last Man Standing - Snark - Judge post
Round 4 - Last Man Standing the sequel - Jplus/Volcano99 - Judge post
Round 5 - The Ants are my Friends - Snark - Judge post
Round 6 - Mapping the Mazes - operator[] - Judge post
Round 7 - Turing Machine Sort - benneh - Judge post

Who here is interested? If interested, please state your programming languages of choice.
Last edited by Snark on Mon Nov 18, 2013 4:49 pm UTC, edited 30 times in total.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Programming Wars

Postby Dason » Mon Jul 01, 2013 5:49 pm UTC

Could be interesting. I guess I'll tentatively toss my hat in

Dason
Language of choice: R
Other languages: Python, C, Java
double epsilon = -.0000001;

User avatar
dudiobugtron
Posts: 1098
Joined: Mon Jul 30, 2012 9:14 am UTC
Location: The Outlier

Re: Programming Wars

Postby dudiobugtron » Tue Jul 02, 2013 2:45 am UTC

This sounds like a really awesome game. Unfortunately, the only programming language I know well enough to play in is pseudocode. ;)

But you will have at least one spectator. :)
Image

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars

Postby Snark » Tue Jul 02, 2013 3:31 am UTC

dudiobugtron wrote:This sounds like a really awesome game. Unfortunately, the only programming language I know well enough to play in is pseudocode. ;)

But you will have at least one spectator. :)

No time like the present to learn!
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Vytron
Posts: 429
Joined: Mon Oct 19, 2009 10:11 am UTC
Location: The Outside. I use She/He/Her/His/Him as gender neutral pronouns :P

Re: Programming Wars

Postby Vytron » Tue Jul 02, 2013 7:25 am UTC

I know Drag 'n Drop Programing from Game Maker, I guess that doesn't count :mrgreen:

Spoiler:
I also know some C, but don't even know how to create a table...

User avatar
Jplus
Posts: 1721
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: Programming Wars

Postby Jplus » Tue Jul 02, 2013 11:13 am UTC

It sounds like something I'd like to participate in, but the upcoming two months I'll be too short on time to actually code anything.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)

User avatar
orangedragonfire
Posts: 13
Joined: Wed Sep 28, 2011 3:45 am UTC
Location: It exists. Probably.

Re: Programming Wars

Postby orangedragonfire » Tue Jul 02, 2013 10:01 pm UTC

I know java and python, both not necessarily well, but good enough to get working programs.

I'm not sure whether I have the time and skill to compete here, but I would like to try.

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars

Postby bluebambue » Tue Jul 02, 2013 10:28 pm UTC

I will, hopefully, attempt a puzzle. I would be using it to learn to code, so it will likely be rather messy or never actually work.

Preferred: C, Java
Other: Python

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars

Postby Snark » Wed Jul 03, 2013 12:01 am UTC

Well that's 4 players, and more might join in later (if camo gets time)!

Questions:
1. Should we make everyone use the same language for clarity? Python is the only we all have in common, but I suppose there'd be no harm in me learning Java if you all want to use that.
2. Since there's only 4 of us, should everyone play in every round with us doing the grading democratically?

My answers:
1. I wouldn't mind either way, but I'm leaning toward everyone using Python. We could switch to all using Java later. It'd be good practice.
2. I wouldn't mind either way, but I'm leading toward everyone competing each round.

What are your thoughts? :)
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Programming Wars

Postby Dason » Wed Jul 03, 2013 2:55 am UTC

Your answers aren't valid since they weren't in the form of a program.
double epsilon = -.0000001;

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars

Postby bluebambue » Wed Jul 03, 2013 3:04 am UTC

1. Python sounds good.
2. I also concur with democratic scoring.

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars

Postby Snark » Wed Jul 03, 2013 3:14 am UTC

Dason wrote:Your answers aren't valid since they weren't in the form of a program.
It was a program... The language being English, and the interpreter being you, the reader. :P
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Xenomortis
Not actually a special flower.
Posts: 1448
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Programming Wars

Postby Xenomortis » Wed Jul 03, 2013 8:23 am UTC

Languages:
C++, C#, VB.NET

There goes your Pythonic consistency. :P
Image

User avatar
cjquines
Posts: 61
Joined: Thu Jul 21, 2011 5:30 am UTC

Re: Programming Wars

Postby cjquines » Wed Jul 03, 2013 10:15 am UTC

Language: Python
What? I only speak one as of now.

User avatar
benneh
Posts: 74
Joined: Tue Aug 26, 2008 8:24 am UTC

Re: Programming Wars

Postby benneh » Wed Jul 03, 2013 12:35 pm UTC

Ooh, this does look interesting.

And, just to be awkward:
Preferred language(s): Haskell
Other language(s): C/C++, Brainfuck

Volcano99
Posts: 56
Joined: Wed Dec 16, 2009 10:10 pm UTC
Location: 350 km SW of The Castle

Re: Programming Wars

Postby Volcano99 » Wed Jul 03, 2013 12:44 pm UTC

Languages:
Python, C/C++, Java

No preferences right now!

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1 Incoming]

Postby Snark » Wed Jul 03, 2013 1:32 pm UTC

Welcome!

Since we now have no language in common, and we have more players, I'm going to make executive decisions on my earlier questions.
1. Use whatever language you want, so long as it's free to legally download. (But please comment your code.)
2. There will be one judge per round who will not play. With 8 players, this will be easier than trying to democratically choose the winner each time.

I'll post the first challenge within 12 hours!
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Programming Wars [Round 1 Incoming]

Postby Dason » Wed Jul 03, 2013 1:43 pm UTC

Quick question: What will the judge's criteria be? Will this be different for each judge and will they be required to announce how they are going to judge the solutions?
double epsilon = -.0000001;

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1 Incoming]

Postby Snark » Wed Jul 03, 2013 2:02 pm UTC

Dason wrote:Quick question: What will the judge's criteria be? Will this be different for each judge and will they be required to announce how they are going to judge the solutions?
Great question. Due to certain questions being quite different from others, I think that each judge should be required to state their judging criteria per challenge they make up. For example, it my 3 example problems in the first post, criteria for 1 would be: Most often correct with ties broken by fastest to output, criteria for 2 would be: Whichever contestant's program wins the tournament, and criteria for 3 would be: Most likely to entertain a child.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
benneh
Posts: 74
Joined: Tue Aug 26, 2008 8:24 am UTC

Re: Programming Wars [Round 1 Incoming]

Postby benneh » Wed Jul 03, 2013 2:06 pm UTC

Seeing as how we are programming here, it might be sensible if the judge writes a program to do the judging automatically, and then makes that program available to the contestants at the start of the contest. That way, everyone knows exactly how the judging will be done.

EDIT: it would also make it possible for the contestants to test their programs easily

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1 Incoming]

Postby Snark » Wed Jul 03, 2013 2:13 pm UTC

benneh wrote:Seeing as how we are programming here, it might be sensible if the judge writes a program to do the judging automatically, and then makes that program available to the contestants at the start of the contest. That way, everyone knows exactly how the judging will be done.

EDIT: it would also make it possible for the contestants to test their programs easily
While this is a good idea in theory, I feel like it may give the players who use the same language as the puzzle master an unfair advantage since the code to check solutions will very likely be somewhat reusable for generating solutions. Also, it doesn't work for subjectively judged puzzles like the children's story one (although I wouldn't be too sad if those types of puzzles were never given).

Edit: I'm welcome to doing this if most people want to though.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars [Round 1 Incoming]

Postby bluebambue » Wed Jul 03, 2013 2:16 pm UTC

I do not want to have to write a solver.

User avatar
Eomund
Posts: 115
Joined: Fri Jun 22, 2012 11:48 pm UTC
Location: The Great White North (Left side)

Re: Programming Wars [Round 1 Incoming]

Postby Eomund » Wed Jul 03, 2013 2:22 pm UTC

This looks like fun.
Languages: Python, Java, C++, PHP, Javascript and a little bit of C#.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1448
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Programming Wars [Round 1 Incoming]

Postby Xenomortis » Wed Jul 03, 2013 2:48 pm UTC

benneh wrote:Seeing as how we are programming here, it might be sensible if the judge writes a program to do the judging automatically, and then makes that program available to the contestants at the start of the contest. That way, everyone knows exactly how the judging will be done.

Is that the Halting Problem I see over the horizon?
Image

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Wed Jul 03, 2013 3:40 pm UTC

Challenge 1: Write a program that can solve Skyscraper puzzles.

Puzzle description:
Spoiler:
A Skyscraper puzzle is a square grid of N by N cells where each number in each cell represents a skyscraper of that height. Their are clues along the outside that state how many skyscrapers are visible from that position. Each row and each column contains the numbers from 1 to N exactly once. Here's a full description: http://www.puzzlemix.com/Skyscraper

Input format:
Spoiler:
There will be a file named "skyscraper_puzzles_unsolved.txt" with the following format:

Code: Select all

2
4
2 3 3 1
2 1 2 2
1 4 2 3
3 1 2 3
5
4 2 1 2 3
3 2 3 2 1
3 4 1 2 2
1 4 3 2 2

The first line states the total number of puzzles in the file. Then each puzzle's clues are printed. The first line of a puzzle's clues states its size. The next 4 lines state the clues for the top line, left to right, then the left line, top to bottom, then the right line, top to bottom, then the bottom line, left to right. There will be no missing clues. The number of puzzles per file will be between 1 and 100, inclusive. The size of each puzzle will be between 3 and 9, inclusive.

Output format:
Spoiler:
Your program should output a file named "skyscraper_puzzles_solved.txt" with the following format:

Code: Select all

2
4
3 2 1 4
4 3 2 1
2 1 4 3
1 4 3 2
5
2 3 5 4 1
1 5 4 3 2
3 4 2 1 5
4 2 1 5 3
5 1 3 2 4

Note that this is the solution to the sample input file. The first line states the total number of puzzles in the file. Then each puzzle's solutions are printed. The first line of a puzzle solution states its size. The next N lines read out the solution for each line in order, from left to right, one line per row. The second puzzle in the sample file is taken from the webpage here: http://www.puzzlemix.com/Skyscraper

Required functionality:
Spoiler:
There should be a variable named "path_to_files" that I will set equal to the (Windows) directory on my computer where the input puzzle file is located and where the output puzzle file should be written.

Bonus requirements:
Spoiler:
If you want extra credit, have your program do the following: If the puzzles clues do not describe a valid puzzle, the output file will, instead of the N lines of output for the output file for that puzzle, print "Invalid puzzle". Sample input:

Code: Select all

2
4
4 4 4 4
1 2 3 4
4 3 2 1
1 2 3 4
4
2 3 3 1
2 1 2 2
1 4 2 3
3 1 2 3
Sample output:

Code: Select all

2
4
Invalid puzzle
4
3 2 1 4
4 3 2 1
2 1 4 3
1 4 3 2

Grading criteria:
Spoiler:
The winning puzzle will always give the right answers for tests when given valid puzzle clues. If more than one puzzle meets this criteria, the winning puzzle will also meet the bonus requirements of correctly identifying invalid puzzles. If more than one puzzle meets both these criteria, the winning puzzle will be the one that outputs its result the fastest. If multiple puzzles meet both the functionality criteria and are negligibly different in run time (less than 5% more time than the fastest puzzle), than the winner will be selected from the finalists programs based on readability and coding practices.


Submit your code to me by Private Message within 7 days, preferably sooner. If it's not straightforward, please include instructions on how to run the code (and how to edit the code to put in a value for the "path_to_files" variable).
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars [Round 1]

Postby bluebambue » Wed Jul 03, 2013 4:01 pm UTC

Question about how much research I can do on the internet. Things I can possibly find on the internet are:
1. Syntax and best practices for my language
2. Psuedocode (of algorithms or something else) to do my general idea for solving the problem
3. Basic strategy/psuedocode for solving skyscraper (or whatever the puzzle is) problems.
4. Fully worked code for solving skyscraper problems.

I'm thinking 1 and 2 are okay and 4 is not. What do people think about 3?

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Wed Jul 03, 2013 4:19 pm UTC

I probably should have checked to make sure they were not fully worked solutions available online, but yes, please don't look up fully created code for solving skyscrapers if it exists.

I'm fine with 1, 2, and 3.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
benneh
Posts: 74
Joined: Tue Aug 26, 2008 8:24 am UTC

Re: Programming Wars [Round 1 Incoming]

Postby benneh » Wed Jul 03, 2013 7:27 pm UTC

bluebambue wrote:I do not want to have to write a solver.

I was assuming that puzzles would be tested by programs anyway, in which case it would make sense to make the testing program available to all. If that's not the case, then ignore my suggestion.
Xenomortis wrote:
benneh wrote:Seeing as how we are programming here, it might be sensible if the judge writes a program to do the judging automatically, and then makes that program available to the contestants at the start of the contest. That way, everyone knows exactly how the judging will be done.

Is that the Halting Problem I see over the horizon?

I am making the (hopefully uncontroversial) assumption that all problems given will be solvable. If not, then I don't think I want to play :P

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars [Round 1]

Postby bluebambue » Wed Jul 03, 2013 8:33 pm UTC

My problem with writing a solver is that I'm not sure if I am technically capable of doing it. It is quite possible that all the things I submit for this competition are going to be full of bugs or don't finish solving the problem. That's okay if it's only me I'm affecting, but not if it's the entire competition. I was just planning on making sure my puzzle was something that I could look at the output and say if it's right.

User avatar
phillip1882
Posts: 145
Joined: Fri Jun 14, 2013 9:11 pm UTC
Location: geogia
Contact:

Re: Programming Wars [Round 1]

Postby phillip1882 » Thu Jul 04, 2013 4:10 pm UTC

best i can do.
edit: removed code as requested.
Last edited by phillip1882 on Thu Jul 04, 2013 5:36 pm UTC, edited 1 time in total.
good luck have fun

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Thu Jul 04, 2013 4:18 pm UTC

Please edit that out and PM it to me. Thanks!
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
benneh
Posts: 74
Joined: Tue Aug 26, 2008 8:24 am UTC

Re: Programming Wars [Round 1]

Postby benneh » Sat Jul 06, 2013 2:49 pm UTC

Sorry, it's likely I'm not going to be able to compete in this round. If everyone else submits an answer and you're waiting for me, assume I'm not going to submit anything and carry on without me. I'll try to rejoin in a later round.

User avatar
bluebambue
An der schönen blauen Donau
Posts: 900
Joined: Wed Oct 03, 2007 5:14 am UTC

Re: Programming Wars [Round 1]

Postby bluebambue » Sat Jul 06, 2013 5:23 pm UTC

I'm going to have to withdraw. I do not have enough time to learn to program right now.

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Sat Jul 06, 2013 6:20 pm UTC

Alright. Just keep up with the thread and jump back in when you're ready.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Programming Wars [Round 1]

Postby Dason » Sat Jul 06, 2013 6:45 pm UTC

Will the judge post all of the solutions after the round is over?
double epsilon = -.0000001;

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Sat Jul 06, 2013 6:56 pm UTC

Dason wrote:Will the judge post all of the solutions after the round is over?

I'd say absolutely unless the entrant asks them specifically asks them not to. That way this can serve as a learning experience - I'll be trying to pick up some Java/whatnot as we go along.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
phillip1882
Posts: 145
Joined: Fri Jun 14, 2013 9:11 pm UTC
Location: geogia
Contact:

Re: Programming Wars [Round 1]

Postby phillip1882 » Sat Jul 06, 2013 9:27 pm UTC

if i happen to be the winner, i have some great ideas for hosting the next round.
good luck have fun

User avatar
Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

Re: Programming Wars [Round 1]

Postby Snark » Sun Jul 07, 2013 2:46 am UTC

As I near my 300th line of code making my own program to solve the problem I set forth, I'm realizing that this was likely too difficult for the first round. I apologize for that.

Could everyone who is attempting this puzzle please indicate how you feel it rates on the difficulty scale? Thanks.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?


Avatar by Matt

User avatar
phillip1882
Posts: 145
Joined: Fri Jun 14, 2013 9:11 pm UTC
Location: geogia
Contact:

Re: Programming Wars [Round 1]

Postby phillip1882 » Sun Jul 07, 2013 3:09 am UTC

I'm not sure there's a good way to logically deduce the solution form the clues.
which is why i...
Spoiler:
randomly generated possible solutions until i found one that worked.
good luck have fun

User avatar
benneh
Posts: 74
Joined: Tue Aug 26, 2008 8:24 am UTC

Re: Programming Wars [Round 1]

Postby benneh » Sun Jul 07, 2013 9:23 am UTC

I did have a think about how to do this, but couldn't come up with anything that wasn't basically just brute force.


Return to “Forum Games”

Who is online

Users browsing this forum: No registered users and 23 guests