User Name
Password
AppleNova Forums » Third-Party Products »

Project Challenge


Register Members List Calendar Search FAQ Posting Guidelines
Project Challenge
Page 1 of 2 [1] 2  Next Thread Tools
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-24, 13:40

this is kind of an idea was mentioend in a thread in the suggestions forum by your's truly. pardon the lameness of this particular challenge, but if we get a fair number of people participating, i or someone else, can come up with better ones. the idea is like this: a programming idea is presented, in general terms, and the membership has to try and implement it. winner gets to wear the "i won the contest" hat*. if possible, the challenge should be vague enough that people can approach it from any programming language they are familiar with. you lose points and credit if you cheat (like googling src code), but you are encouraged to discuss possible ideas and solutions with the membership.

so, ai, heres your first 'project challenge'. implement the game "31". if you are unfamiliar, it works like this: a matrix (two dimensional array, in this case 6x6) of the numbers 1->6 is created (each duplicated 6 times across), and presented to the users. two users (or user and computer, implementor's choice) alternate selecting a number from the list. after the number is picked, its removed from the options (note: so each number [1->6] can be picked 6 times). the running sum of the selected numbers is maintained as well (preferably visible to the user). the person who makes the total exactly equal "31" wins. if a user pushes the total over 31, they lose. under 31, and the game continues. (yes the game is incredibly lame, but so is my creativity.) extra poitns to whomever can make a computer who can't win (cuz who wants to lose?). and even more brownie points to whoever can make the computer unbeatable. also, you can try making 6x5, 5x5, or nxm versions, possibly with different end totals.

here's an example:
i go first and pick 6. cpu goes and picks 1 (total=7). i do 5, cpu does 6. (total 18). i do 6, cpu does 6 (30). i do 1 (total=31). i win. oh boy, that was fun!

edit: submitters can optionally make binaries/run-only versions of the code available to the public (i can host em if you like), but source should be submitted to the judge panel (for now, i am the judge panel. if anyone would like to join our illustrious group, pm me). try not to give away the answer until the contest is declared closed. and don't be dissuaded if someone beats you to finishing, cuz you could do it in another language, or do one of the bonus challenges.

edit #2: submitters should put their tarballed (.tar.bz2 or .tar.gz**), or .zip'd, submissions into my ftp site. its not up 24/7, but damn near most of the time. ftp://thuhfreak.isa-geek.com. you can put anything for a username, if asked. it shouldn't ask for a password. when you upload, your file(s) will be magically scooped away to some far off land (the judging area), then an empty file will be put in their place. if an empty file doesn't appear after your upload is done, pm me. or if there are any problems, pm me. oh, and please dont hack my poor little ftp server.

edit #3: deadline. i think friday at noon (EDT, which is -4 GMT) is a good cutoff, to make sure this doens't last forever.

* hat not included, nor will it be furnished by thuh Freak. also, hat should be released to the next winner of the next challenge. maybe instead of a hat, we could use the member status dealie.

** if you are unfamiliar with 'tarballing', it goes like this: put everything you want to give away into a folder. for example, the "tarball" folder, and put it in your home directory. open up Terminal.app, and open a new window. type in:
Code:
cd; tar c tarball > tarball.tar
replacing 'tarball' in the above with your foldername. now you have a "Taped ARchive". next step is compression.
Code:
cd; bzip2 tarball.tar #OR cd; gzip tarball.tar
bzip2 will take longer, but will make a more highly compressed file (not noticeable, generally, for small files). after running tar and bzip2, you have a file named "tarball.tar.bz2" (or "tarball.tar.gz" if you did tar and gzip). send that file to me for submission.
note: the previous stpes may require the BSD subsystem, or some other configurably removeable part of the os. I know that the tar, bzip2 and gzip programs are all available through fink, if you don't have them.

Last edited by thuh Freak : 2004-05-25 at 13:00. Reason: update to contest rools
  quote
AirSluf
Member
 
Join Date: May 2004
Location:
 
2004-05-24, 16:16

XXXXX

Last edited by AirSluf : 2004-11-15 at 22:53.
  quote
hyperb0le
Member
 
Join Date: May 2004
Location: Atlanta, GA
Send a message via AIM to hyperb0le  
2004-05-24, 17:25

When is the deadline? I would enter, but I'm up to my nose in code for a word processor I'm writing. If the deadline isn't too soon, though, I may give it a shot.

"I understand small business growth. I was one." - George W. Bush
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-24, 17:34

Quote:
Originally Posted by hyperb0le
When is the deadline? I would enter, but I'm up to my nose in code for a word processor I'm writing. If the deadline isn't too soon, though, I may give it a shot.
i was thinking about making a deadline, but i decided not to. i want this to be as much of a no-pressure "contest" as possible. something to play with, and discuss, but not somehting to get in a tizzy about, nor to skip work/school/life over. but, on the other hand, the sooner we get some interest, the sooner i can come up with some non-lame challenges. i've cooked up a few already.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2004-05-24, 18:43

Coolies. This is the exact type of idea I need to build up my coding. I will try and do this as a cocoa app, but if interest is a bit slow to start I will make it as a php web page.

OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-24, 19:03

Anybody have a link to a free C/C++ code obfuscator?
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-24, 19:55

Quote:
Originally Posted by spotcatbug
Anybody have a link to a free C/C++ code obfuscator?
perhaps i need to clarify (note: an edit will be pending shortly in the top message).
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-25, 08:45

Alright, I'm trying it out. I like puzzles and contests.

One question: who wins if there's no possible move? Like, for example, if the total is 30 and there aren't any more 1's to choose.

edit: Oh wait. Never mind. I see. The next player would be forced to make the total greater than 31 and they would lose.

Ugh.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-25, 09:09

Quote:
Originally Posted by spotcatbug
Alright, I'm trying it out. I like puzzles and contests.

One question: who wins if there's no possible move? Like, for example, if the total is 30 and there aren't any more 1's to choose.

edit: Oh wait. Never mind. I see. The next player would be forced to make the total greater than 31 and they would lose.
correct.

hint: a good strategy, like maybe for the unbeatable computer version, would be to look ahead one move and make sure that your opponent will put you within range of 31; another might be that you can put him so close to 31, yet can't hit it exactly. personally, i like the satisfaction of when i hit 31, rather than when my opponent goes over, but either win is acceptable in the rules.
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-25, 09:51

I was about to post my initial stab, but I think we need a system for naming our entries first (binaries, source folders, whatever). Otherwise we'll have a bunch of "aichallenge1"'s (and the like) posted.

I was thinking along the lines of using our AI names followed by some indication of which challenge it is. Like, for me, on this challenge "spotcatbug_1" or "spotcatbug_AI1".

Also, is anybody else trying this? I don't want to be the only one.

Ugh.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-25, 10:25

Quote:
Originally Posted by spotcatbug
I was about to post my initial stab, but I think we need a system for naming our entries first (binaries, source folders, whatever). Otherwise we'll have a bunch of "aichallenge1"'s (and the like) posted.

I was thinking along the lines of using our AI names followed by some indication of which challenge it is. Like, for me, on this challenge "spotcatbug_1" or "spotcatbug_AI1".

Also, is anybody else trying this? I don't want to be the only one.
well, first, i don't think you're the only one. the thread has gotten a lot of views (hopefully interested hackers, and not just me poking in every so often). the lack of deadline might be having a procrastination effect on potential contestants.

naming convention sounds like a good idea. how about ai name, then challenge name (31), then submission number (incase someone submits future versions, potentially for the bonus challenges). so "thuhFreak_31_1", and underscores are interchangeable with spaces. i prefer for submissions to be tarballed (.tar.bz2 or .tar.gz), and hopefully have a folder at the top level with sources/binaries inside. your ai name should be near the top of the source files as well. i'm going to setup an anonymous ftp server, where people can make submissions. i'll update the top message when its in place.
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-25, 12:11

Quote:
Originally Posted by thuh Freak
i prefer for submissions to be tarballed (.tar.bz2 or .tar.gz)
Is .zip ok? Is there a reason not to use .zip? I kinda like being able to just right-click on the file/folder in the Finder and then choose "Create Archive of..." from the contextual menu.

Ugh.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-25, 12:18

Quote:
Originally Posted by spotcatbug
Is .zip ok? Is there a reason not to use .zip? I kinda like being able to just right-click on the file/folder in the Finder and then choose "Create Archive of..." from the contextual menu.
.zip is ok, i'm just trying to avoid .sit, b/c i dont have stuffit, and dont want it on my computer.
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-25, 12:22

Ok, here's the binary for my first attempt. It's a command line app (should be able to just double-click and it'll launch in the terminal).

I don't know if the computer is unbeatable, but I think it's pretty good. I haven't been able to beat it yet.

edit: I added the ability to change the computer's intentions from "try to win" to "try to lose."

edit2: I didn't switch to the "Deployment" build style in Xcode. This binary works.

Ugh.

Last edited by spotcatbug : 2004-05-26 at 09:12. Reason: submission 3
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-25, 12:51

Quote:
Originally Posted by spotcatbug
Ok, here's the binary for my first attempt. It's a command line app (should be able to just double-click and it'll launch in the terminal).

I don't know if the computer is unbeatable, but I think it's pretty good. I haven't been able to beat it yet.
i'll hold off on trying it out, until we declare the challenge over, lest i unnecessarily prejudge. i think friday noon is a good cutoff date. if you can think of any updates, or changes, feel free to submit them.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-25, 12:52

Quote:
Originally Posted by hyperb0le
When is the deadline? I would enter, but I'm up to my nose in code for a word processor I'm writing. If the deadline isn't too soon, though, I may give it a shot.
ok, i decided to put in a deadline, just so this thing doesn't last forever. friday noon, then shortly after (probably mid saturday) i'll announce the winner, and the next challenge (it should hopefully be tougher).
  quote
AirSluf
Member
 
Join Date: May 2004
Location:
 
2004-05-26, 00:32

XXXXX

Last edited by AirSluf : 2004-11-15 at 22:55.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-26, 10:38

Quote:
Originally Posted by AirSluf
I'm in for a 2 player version, working a computer opponent next.
i patiently await your second submission.

i was wondering, aside from the lameness of the challenge, do you guys feel it was too easy, too hard, just right? disrespective of the difficulty, do you feel like you have enough time, too much time? i got a pretty crafty next challenge lined up, and i was thinking it'll be like a one day event, instead of most of a week. but i don't know if its beneath or above you guys. (thinking aloud...) maybe for the next one i'll try to do a few concurrent challenges, with various difficulties and deadlines. and i'll see which one gets more action.
  quote
AirSluf
Member
 
Join Date: May 2004
Location:
 
2004-05-26, 13:12

XXXXX

Last edited by AirSluf : 2004-11-15 at 22:53.
  quote
AirSluf
Member
 
Join Date: May 2004
Location:
 
2004-05-26, 22:11

XXXXX

Last edited by AirSluf : 2004-11-15 at 22:48.
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2004-05-27, 17:14

I am on page 58 of my "Beginners Guide to C". Will I get extra points if I actually make a working submission by tomorrow afternoon? (I don't even know how to define an array yet!)

OK, I have given up keeping this sig up to date. Lets just say I'm the guy that installs every latest version as soon as its available!
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-28, 08:52

Quote:
Originally Posted by thuh Freak
i was wondering, aside from the lameness of the challenge, do you guys feel it was too easy, too hard, just right? disrespective of the difficulty, do you feel like you have enough time, too much time? i got a pretty crafty next challenge lined up, and i was thinking it'll be like a one day event, instead of most of a week. but i don't know if its beneath or above you guys. (thinking aloud...) maybe for the next one i'll try to do a few concurrent challenges, with various difficulties and deadlines. and i'll see which one gets more action.
I liked this challenge (31). There was more time than I needed, but that's not always going to be the case for me. I just happened to have some free time at the start of this one. I think roughly a week (or however long this challenge lasted) is probably going to be a pretty good amount of time, regardless of the difficulty. That way it doesn't come down to timing (the winner is the person that happened to have the right scheduling). Having more than one challenge going at a time sounds best to me; people could pick which they like/is at their skill level/they have time for.

Ugh.
  quote
Ryan
Veteran Member
 
Join Date: May 2004
Location: Promise Land of Trustafarians
 
2004-05-28, 15:47

Its a little late, where I live at least, but here's my submission:

http://homepage.mac.com/ryantann/cubedude_31.py

Its in Python, because I heard that it was an easy language to start with. It can be run from the Terminal with(if its in your home folder) "python cubedude_31.py"

It isn't much, as this is my first real project. All I've done before this is simple stuff like the quadratic formula and other various equations. For example, my submission doesn't allow the computer to be an opponent, or even make a distiction between Player 1 and 2.
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-05-29, 15:38

I've got next week off. More challenges, please!
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-05-29, 19:42

The results are in: spotcatbug is the winner for the first ever semi-regular AI.org Project Challenge. i'm going to post to the 'member status' thread as soon as i'm done here. horray for scb! spotcatbug was the first submitter to send in a working rendition of the "31" game, with nearly-perfect ai. the challenge was actually a trick, there is no way to guarantee a win, if the first person knows what they are doing. and fyi, to win at 31, a person should pass the turn back to their opponent with the following totals: 3, 10, 17, 24, 31. if the first player starts at 3, and doesn't stray from those, he'll win. if either player ever strays from those numbers, their opponent can pick it up from there and win. thanks to all the contestants (all three of you ). sorry i didn't post earlier. i had checked in every couple of hours and the site was down.

And, as promised, I have more than one challenge prepared for ya'll. The first one, we'll call it "Age", has a language requirement. i broke one of my own damned rools. but i like this one, and it wouldn't be as challenging if it was language-agnostic. if you don't know sql (or any of its variants), i recommend reading one of the numerous tutorials out there on the web. ok, now the "Age" challenge: you have a table "People", with columns "Name" (varchar 50), and "Age" (smallint). There are 4 records in there, as follows: Laura:15, Jane:20, Bob:10, Nickie:17. try to find, in the simplest, shortest, most efficient, quickest or just any old way that works, a sql query that will return the oldest person's name. and you can't just hard code the name, like "select name from people where name='jane';". your query has to be able to find the oldest person even if i remove jane from the table, or add an older person (or people) to the table. also, you are only allowed to return the oldest person's name (no more, no less; just one record). for this challenge, don't put the answer anywhere public. you can post it to my ftp server (its not up right now, but should be in less than an hour).

the simul-challenge this week is called "Monty Hall", or "MH" for short (when you make your submissions). i've mentioned it once or twice before back at the old ai, so you may have heard of it from me already; or perhaps you've heard of this problem on your own adventures. the idea is this: 3 doors are presented to the user. behind two doors are "zonks", basically they are loser doors. one door has the grand prize (in our game, the grand prize is just +1 on their score; and a zonk is no change). the user selects a door. but to twist the game a bit, at this point Monty Hall opens one of the doors (NOT the one the user selected, AND NOT the grand prize; thus it is ALWAYS a zonk) and says to the user "look, this one is a zonk. would you like to change your answer?" as math would have it, the user has a 66 2/3% of being right if they change at that middle junction. your challenge, should you choose to accept it, is to create a comptuer simulation of the Monty Hall problem. the submission should have two play modes: live and statistic (or your implementation can do either). in live mode, the user selects a door, a zonk is revelaed and the user gets to rechoose or stick to their answer; score should be maintained and be visible when the user wants it, as well as the total number of live games. in statistic mode, the user says how many times to run the game, and the computer acts in the player's place: randomly selects a door, a zonk is revealed by Monty, and then always changes their selection. a count should be maintained of how many successes, and failures, and percentages should be made available. note: in both live and statistic modes, the prize door should be randomly chosen before the game starts, and prize behind the doors doesn't move once its been selected (until the next round begins). also, in statistic mode, the computer shouldn't cheat . a good measure of how good your statistic mode will be the proximity to 66.666% as more iterations are done. for this challenge, you can post binaries in public, but try to keep source code hidden (ie, just on my ftp server, or in PMs). there are no restrictions on language for the MH problem.

both of these challenges are due Friday at noon (Eastern Daylight Time) again.
  quote
spotcatbug
Veteran Member
 
Join Date: May 2004
Location: Clayton, NC
 
2004-06-02, 16:02

This thread is still alive.

My Monty Hall submission is here. I did it as an applet, so you can try it just by clicking that link. The interface is sorta not laid-out too nice, but should be easy to figure out.

P.S. Does anybody know why the background of the applet is brushed metal?

Ugh.
  quote
SilentEchoes
Unique Like Everyone Else
 
Join Date: May 2004
Location: Rochester, NY
Send a message via AIM to SilentEchoes  
2004-06-02, 18:47

Aw cmon thuh Freak, Your first challenge could be done entirely with a select statement. You gotta post something a bit more challenging than that.
  quote
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2004-06-02, 19:44

Quote:
Originally Posted by SilentEchoes
Aw cmon thuh Freak, Your first challenge could be done entirely with a select statement. You gotta post something a bit more challenging than that.
Shut up, I can do this one in less then a minute
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-06-02, 19:44

Quote:
Originally Posted by SilentEchoes
Aw cmon thuh Freak, Your first challenge could be done entirely with a select statement. You gotta post something a bit more challenging than that.
yea. i kno. some people, even sql "experts" have trouble on it though. the dba at work uses it as a question for anyone we hire in IT. its fun to watch people squirm when they can't get it immediately.
  quote
SilentEchoes
Unique Like Everyone Else
 
Join Date: May 2004
Location: Rochester, NY
Send a message via AIM to SilentEchoes  
2004-06-02, 22:16

Yeah its funny because when I first read it I expected it to be all complicated so in my head I immediately started picturing the structure of the code with arrays and whatnot but then as I was typing it out I was like oh duh.

WARNING: Do not let Dr. Mario touch your genitals. He is not a real doctor.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Page 1 of 2 [1] 2  Next

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 14:12.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova