After the success of the first ColdFusion contest, I have decided to go ahead and run a second contest. As before, it will involve games because, well, I think games are cool, and by their very nature games present many interesting challenges.
This contest will be for intermediate developers. As before, I'm going to count on your honesty. If you are a ColdFusion Ninja, than wait till the next contest. (I have what I think is an uber cool idea for that one.) This contest will be to create a Blackjack game. In order to make the design a bit easier, I found this url, which contains card images that are free for anyone to use. All entries must use one of these card sets. Now for the particulars:
- I am not a professional gambler, so the following rules will be a subset of "real" Blackjack games.
- Every Blackjack game will begin by having two cards given to the player, and two cards given to computer. One card should be handed out at a time. One of the computer's cards will be visible.
- The player goes first. The player has two options. They can either "hit", which means ask for a new card, or "stay", at which point the computer takes over.
- The point of Blackjack is to get as close to 21 points as possible. If you go over 21 points, your game is over.
- Aces can be either one or eleven.
- If the computer and the player tie, the computer (dealer) wins.
- The computer must hit if the value of it's hand is less than 17. Once the value becomes 17 or higher, the dealer must stay.
- There is no "double down", "splitting pairs", or getting 5 cards for an automatic win. Again - I want to keep things simple.
- The game must use session management and track your progress though multiple hands. It is up to you to decide how much money to give the player.
- You do not need to keep track of cards after a hand. In other words, you can reshuffle for each hand.
Design is not important - however - there were some cool design tricks I saw in the last design that I thought worked well. These weren't "artsy" things, but UI things that improved the game. I hope that distinction makes sense. Contest entries should be emailed to me at ray@camdenfamily.com. The deadline is two weeks from today, November 13th.
Oh - so I bet you want to know what the prize is? Well, it's just a small little piece of software... a full copy of ColdFusion MX Standard, a 1,299 dollar value. Big thanks go to Macromedia for sponsoring this prize.
If you have any questions on the rules, please post it here so everyone can benefit from it - and with that - good luck!
Edited: Just a quick note as I don't think I made it obvious. You will start the player with a certain amount of money. For each hand the player decides how much they want to bet, and obviously it must be less than or equal to what they have in their bank.
Archived Comments
Well I am definetely in. I am not a Coldfusion Ninja, but I do know alot about it. Well anyway, I have no money for anything, especially Coldfusion Standard, and I always wanted it, so yay.
I'll send you my written code within a few days!
I'm curious what constitutes the clasification of "ColdFusion Ninja"? I know it's difficult to quantify but if you've got some guidelines it might help. By the way - I've got a challenge unlike any other for you... but we'll talk about that off-list. I will say that it's a "ninja-only" type contest and that I'd be shocked if you got any entries... I'm developing it myself and am planning to release it as a "learn by example" tool, as a fun play thing, and as an open source app. that others can help to refine and make better. More on that later (way later) on my blog but it's something you and I might want to team up on as a kind of "master challenge". BTW - make sure you keep Hal out of this contest - development skills aside, his prowess as a card player should disqualify him. Sorry, Hal ;)
I'm sure he will get entries, because I'm entering and you are entering, so that's already 2 entries. Although, this would be good enough to license and sell...that's what I am worried about.
Matt - the -next- contest is for the CF Ninja. ;)
Simon - Well - it's up in the air I mean - if you feel like you know CF and are 'decent' at it, I'd probably consider that intermediate. You and I would NOT be considered intermediate. As for Hal, I don't think I'd even let him in on the advanced contest - it wouldn't be fair. :)
Matt - Are you joking? I certainly don't plan on reselling any of this, but as before, the code WILL be shared.
Yea, well I guess I'll share my code for a shot at Coldfusion Standard. =)
So here is where it gets confusing. I am nowhere near Simon or Hal’s level, but I do not consider myself as intermediate.
I think I’ll take a shot at the Ninja level; very curious to see what Ray or Simon have in mind.
FYI - I added a amall note to clarify the game a bit. Probably obvious, but...
Wow, what a prize! Ive got some guys im going to tell about this for sure. Definately looking forward to the next contest, but it beggs the question, if the prize for this is so nice, what could the prize for the next contest be?!
I've certainly offered bigger and better prizes fr CFDJ - it didn't seem to have much impact on the number or quality of entries (I had 0 entries the last two contests). That said, I can help you secure a "bigger" prize next go-around, as it seems more people respond to contests held by blogs than via the megazine (I'm still surprised I didn't get any takers for my last 2 contests). Ping me off-list for more on talk about prize and the next contest.
What was the prize of your 2 contests?
If I recall correctly the last prize was three licenses of Kollection version 3.
Will the use of anything be frowned upon? For example, the use of JavaScript to enhance the game a little. Just want to make sure before I give this a shot.
Do you want this to be a 1 script page or can i make it CFC based? or does it matter...just upload the folder and run yes?
Jason - you can use JS.
Derek P - I won't say it doesn't matter - because I tend to view the use of CFCs as a good thing, but it is up to you.
If we entered the last contest, can we also enter this one? I think I'm a little more advanced than beginner, but maybe a little less than intermediate.
Andy, that is fine.
How does the dealer evaluate Aces when determining to hit or stay?
For example, if the dealer has an Ace and a 6 he/she holds either a 7 or a 17. Does the dealer have to stay, or is there the option of playing the Ace low and taking another card?
Dealer has to stay.
In the original contest, you asked to simply unzip the file and have it run. For this contest, are we allowed to use a framework? (Fusebox, Model-Glue, Mach-II) Can we require a single mapping for CFCs?
This contest is more of how close the game comes to the real blackjack rather than how good you are of a coder. Anybody else feel the same?
> This contest is more of how close the game comes to the
> real blackjack rather than how good you are of a coder.
> Anybody else feel the same?
I feel quite the opposite, actually. Ray has simplified the game in a number of ways that differ from the "real blackjack": only one player, no doubling down or splitting, only one deck instead of a show of many decks, and reshuffling after each hand.
After just a few hours of thought I can see that this contest will end up being a lot more complex that I first thought, and that has absolutely nothing to do with the mechanics of blackjack itself.
Just my 2 cents.
Matt - trust me - if you make a mistake in the rules of BJ I'm not going to disqualify you. (Although one could say following specs is important. ;)
Oh ofcoarse not, and I am definetely doing this. I will try my best to win.
database or not?
No db. It should be "Expand and Run", although I didn't say it in the formal specs - just like last time.
What if the player busts and the dealer has 14, does the dealer need to hit until they reach 17+ or bust?
anytime ive played, in any casino, when the players bust, the dealer needs not do a single thing else, but ask for ante and deal em up!
tw
tw is right. When the player busts, the hand is over and the player loses his money.
Sounds good. Just had to make sure, I am not a big Black Jack player.
Did I miss on how you win? Smallest code? Most elegant code? You cant really time it like you could the maze. . .
DRE
I take every entry and print it out. I then let my dog in the room and see which one he sits on.
Now - um - it is based on purely personal feelings. That's not very fair, but hey, this whole contest is -mainly- for educational purposes - so I can share how people solve problems and dissect the entries.
Just to be sure, is it played with a full deck of cards and pictures are 10 (except ace)? How does it work if you hit a card do you have to raise the bet?
Face cards (pictures) are worth ten points. Aces are 1 or 11. You do not raise your bet. You start the game with a bet (I bet X dollars) and the bet doesn't change during the hand. When the hand is over, you pick a new bet.
Anything special when they lose all their money? Go negative and keep playing, or do a Game Over/Start Again thing?
I'd say, without speaking for raymond, that you should use your judgment for things like that.
creativity on your part is part of the game.
tony
Totally up to you.
I know this is a cf contest and someone already asked if we can use javascript, but I have way too much javascript going on here. I cant figure out another way to do, my goal was not to leave the screen ie no form submission and I just dont see it possible without tons of javascript.
ive done my whole entry with no javascript, and it works GREAT. use cf.
without any form submissions? I have tried it with for submissions but the problem is you have no access to dom?
i guess im just not of the opinion that page reloads are a bad thing. i wouldnt totally rule out ANY javascript, as its VERY useful, and certainly has its place, but i wouldnt focus too much on it, being that its a cf contest. thats all. good luck :)
dan -
my feeling (for whatever it's worth) is that this is a CF contest. Yeah, you could do it with no page reloads...but now it's a JS app...not CF.
Ideally, I get what you're saying about page refreshes. If I were building this as a commercial app (because the world needs another blackjack game), I would probably want to see it in JS (or AJAX), or even Flash/Flex.
But the gist of the contest here is to see how we all do it using CF.
err...um...now that i scroll up and read a bit...yeah, what Weeg said :)
so far the only JS i've added to mine is some client side validation to make sure the bet amount is numeric (and less than the total player amount).
</ $0.02> :)
Charlie -
Thanks for the feedback. After reading your post I can agree 100%. I guess when faced with a problem I am always look for the best solution and not the right one, something I need to get better at :)
Mine will be done by the weekend, good luck everyone.
When you say cards should be dealt one at a time, are you you meaning that there should be some interaction when each card is dealt? Or are you saying that behind the scenes each card is dealt one at a time?
In my app, the initial 4 cards are shown at once (1 dealer card face down, of course), but they dealt behind the scenes one at a time. I think this is what you meant, but just to clarify.
Sorry for the delay in getting back to you. Yes - what I meant is that you give one card to the player, then the dealer, then player, then dealer. You don't have to _show_ that, it just needs to happen that way, to be fair. (And I don't really care if dealer gets a card first.)
If I were writting this as a commercial app, I'd probably avoid using Ajax. The prospects of what you could do with something like Greasemonkey make me shudder. All the checks you would have to perform to avoid cheating would make me stay as far away from JS as possible.