473,408 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

programming battleship issue

hi, im trying to program the game battleship but i cant figure out how to
code how people can place the ships and keep track of it. Ive been trying and
researching for a couple days now and am at the end of my rope...if anyone
cal help thatd b awsome.

i have a 10x10 picturebox grid initialized into a 2d array to hold them. i
just need to have a way to have them pick where they want their ships and
keep track of it....thanks to anyone that can help
--
-iwdu15
Jan 12 '06 #1
1 1513
Does this answer your question:

(*) Have a box on the side with the still-to-be-placed ships
(*) User clicks on one of these (removing ship from box), then a location in
the grid.
(*) Ship is placed there in current orientation (allow it to clip).
(*) have two rotate-buttons for each rotation direction.
(*) Hitting these buttons rotates the last placed ship about its placement
point.
(*) Have a 'finish' button. This is only active if all ships have been
placed legally.
(*) Have a "delete" button also. Clicking on a placed ship and then 'delete'
will remove it from the grid and place it back in the side box.
(*) Clicking on a ship already placed in in grid 'selects' it. It can now be
rotated (again), and clicking on an empty locatin in grid will place it
there at current orientation if legal.

'Legally" mean no clipping and no overlapping.

You can get fancy by not allowing rotations to stop in illegal positions,
and/or disallow placing ships for which no orientation is legal.

That should get you started... : )

[==P==]

"iwdu15" <jmmgoalsteratyahoodotcom> wrote in message
news:2B**********************************@microsof t.com...
hi, im trying to program the game battleship but i cant figure out how to
code how people can place the ships and keep track of it. Ive been trying
and
researching for a couple days now and am at the end of my rope...if anyone
cal help thatd b awsome.

i have a 10x10 picturebox grid initialized into a 2d array to hold them. i
just need to have a way to have them pick where they want their ships and
keep track of it....thanks to anyone that can help
--
-iwdu15

Jan 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: BORT | last post by:
Please forgive me if this is TOO newbie-ish. I am toying with the idea of teaching my ten year old a little about programming. I started my search with something like "best FREE programming...
0
by: Michael Goettsche | last post by:
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game . I know this game could be written without a server, but the...
42
by: Kevin Spencer | last post by:
Is it just me, or am I really observing a trend away from analysis and probem-solving amongst programmers? Let me be more specific: It seems that every day, in greater numbers, people are coming...
4
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
24
by: gonzo86 | last post by:
Hey, Im kind of new to C++ and I'm working on making a Battleship program. I need to be able to output a screen with just dots on it for when people havent tried those spots and then be able to...
5
by: muna123 | last post by:
hi, I need help in battleship game here is my code: #include <stdio.h> void draw_game(char board, int maway, int mleft, int score, char prevmove);
19
by: Olivia Jaden | last post by:
Hi, I was about to create a 8x8 battleship program. there should be 8 ships in total with 1x1 size. However, I do not know how to place the ships randomly. Below are some of the codes that I...
43
by: Adem24 | last post by:
The World Joint Programming Language Standardization Committe (WJPLSC) hereby proclaims to the people of the world that a new programming language is needed for the benefit of the whole mankind in...
14
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
As far as I know, the C Standard has no mention of multi-threaded programming; it has no mention of how to achieve multi-threaded programming, nor does it mention whether the language or its...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.