![]() |
beginner project -- Bingo!
I was just recently played bingo, and I decided: "Hey, I could probably make a bingo program!".
The language would be C++ with a bingo class. A two-dimensional array would hold 5 colums with an array of random numbers one through 15. The idea would be that there are AI boards, and one computer board. Random numbers are called out, and when all the numbers are called on somebodie's board ( trying to figure out how to keep track of a line ) , the player that wins ( either AI or human ), gets a point. I could keep track of numbers that are called by marking an equivelent array with ones and zeroes, then comparing them. Is this feasable? What do all think? |
It's okay, I only would not call it AI, since it is just doing some checks.. about finding the lines, just loop five times through your array which checks horizontal lines, five times for the vertical lines, and write two checks for the diagonal lines.
Good luck :) |
Well, this is what I have so far:
bingo.h: :
#ifndef BINGO_H_bingo.cpp: :
#include <iostream>Sample (simple ) program to show results: :
|
Funkadelic. Must try it out soon.
|
Ok, I finished building the bulk of the class, now I just have to build the user interface for the program ( and maybe tweak and add a few functions ).
here is bingo.h :
bingo.cpp (about 240 lines, watch out. ) :
and the code to test it ( press enter to continue, untill there is a winner, calling number and filling the spaces at the same time. It ususually takes about 25 hits to gwt a winner. :
|
As soon as I get the net back at home (damn hurricane), I will compile this and check it out.
|
Thanks Infinite Recursion, I would love some feedback.:)
Keep in mind that the test program just tests the class, it isn't the full version. I am working on the more user friendly version. |
Good work, and for a suggestion: Let the user pick the numbers that will be on the board (and an option for it to be chosen at random) .
|
Finished -- check in the finished projects section :)
|
Have you looked at PHP? I'm asking you this because I'm thinking that you want to make the game graphical, right? The problem is that in C++ you have to download graphics libraries or use some API functions to code such as simple game as bingo. I'd suggest making it a web program but it's your call. Oh... you finished it... cool... I'll try it!
|
| All times are GMT -5. The time now is 11:10 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC