Source code - Battle_Ship.zip

Find C and C++ source code to help you learn to program. You can submit your own code, or you can simply browse and download the code of others.

Index :: Games / Battle_Ship.zip
Battle_Ship.zip
resource information
Title Battle_Ship.zip
URL http://www.cprogramming.com/source/Battle_Ship.zip
Category 2
Description Battle ship without grapical interface.
Contact Michael_Marques
Added 06-17-2003 at 05:43 p.m.
Last Updated 06-17-2003 at 06:26 p.m.
rating
Current Rating 4.11627906976744
Rate Resource
 
reviews
Number of Reviews 51
Review this Resource
Reviews:
  • personal loans online <a href="https://personalloansonline.us.org">unsecured personal loans</a> loans payday <a href=https://personalloansonline.us.org>unsecured personal loans</a>
    posted at 10:47 p.m. on 01-21-2018
  • argumentative essays <a href="https://argumentativeessay.us.com">argumentative essay</a> writing homework help <a href=https://argumentativeessay.us.com>paper writing</a>
    posted at 04:07 p.m. on 01-14-2018
  • cash loans no credit check <a href="https://cashloans.us.com">cash loans</a> cash now <a href=https://cashloans.us.com>cash loans no credit check</a>
    posted at 01:44 p.m. on 01-13-2018
  • direct payday loan lenders <a href="https://payday.us.com">short term payday loan</a> payday loan online <a href=https://payday.us.com>fast cash loans</a>
    posted at 12:10 a.m. on 01-13-2018
  • short term loans direct lenders <a href="https://shorttermloansdirectlenders.webcam">easy online payday loans</a> short term loans direct lenders <a href=https://shorttermloansdirectlenders.webcam>short term loans direct lenders</a> quick cash loan <a href="https://internetpaydayloans.stream">easy payday loans</a> internet payday loans <a href=https://internetpaydayloans.stream>small payday loans</a> help on my math homework <a href="https://researchwriting.webcam">research writing</a> research essay <a href=https://researchwriting.webcam>research report</a> direct lenders payday loans <a href="https://paydayloansdirectlenders.stream">direct payday lenders online</a> online payday loans direct lenders <a href=https://paydayloansdirectlenders.stream>payday advance</a> payday loan direct lender <a href="https://paydayloandirectlender.webcam">payday loan direct lender</a> payday loan direct lender <a href=https://paydayloandirectlender.webcam>payday loans online direct lender</a> easy payday loans online <a href="https://thebestonlinepaydayloans.loan">the best online payday loans</a> payday loan <a href=https://thebestonlinepaydayloans.loan>best payday loans online</a> payday loans online <a href="https://easyonlinepaydayloans.science">payday loans online</a> fast online payday loans <a href=https://easyonlinepaydayloans.science>online cash advance</a>
    posted at 12:30 a.m. on 01-12-2018
  • cash loans <a href="https://cashadvance.us.org">cash advance</a> online payday advance <a href=https://cashadvance.us.org>online payday advance</a>
    posted at 03:48 p.m. on 01-11-2018
  • auto insurance quotes <a href="https://autoinsurancequotes.us.com">cheap auto insurance quotes</a> auto insurance company <a href=https://autoinsurancequotes.us.com>cheap auto insurance quotes</a>
    posted at 02:07 a.m. on 12-25-2017
  • best websites for essays <a href=https://buyessays.us.com>buy essay</a> help writing essays for college <a href=https://buyessays.us.com>order essay online cheap</a>
    posted at 08:01 p.m. on 11-07-2017
  • WELLITSVERYGOOD
    posted at 07:45 a.m. on 10-01-2017
  • <a href=https://onlineloans.us.com/>online payday advance loan</a>
    posted at 01:38 p.m. on 09-02-2017
  • <a href=http://buycialisonline.us.org/>buy cialis online</a>
    posted at 10:01 p.m. on 08-31-2017
  • <a href=http://buycialisonline.us.org/>cialis online</a>
    posted at 09:42 p.m. on 08-31-2017
  • wh0cd391589 <a href=http://buytretinoin.us.org/>Tretinoin Gel</a> <a href=http://viagratablet.us.com/>viagra online</a>
    posted at 11:30 p.m. on 07-22-2017
  • wh0cd171168 <a href=http://orderdiflucanonline.us.com/>order diflucan online</a> <a href=http://buydiflucan.us.org/>generic for diflucan</a> <a href=http://metformin500mg.us.com/>Metformin 500 Mg</a>
    posted at 08:16 p.m. on 07-09-2017
  • wh0cd24220 <a href=http://ilosone.reisen/>buy ilosone</a> <a href=http://cyklokapron.reisen/>cyklokapron</a> <a href=http://imdur.reisen/>imdur</a> <a href=http://hoodia.world/>where to buy hoodia</a> <a href=http://pilex.reisen/>pilex</a> <a href=http://endep.reisen/>endep</a> <a href=http://myambutol.world/>myambutol</a>
    posted at 03:51 p.m. on 07-09-2017
  • wh0cd441238 <a href=http://cephalexinonline.us.com/>cephalexin</a> <a href=http://buytetracycline.us.com/>generic tetracycline</a> <a href=http://cheapdiflucan.us.com/>buy fluconazole online</a> <a href=http://buyadalat.us.com/>adalat without prescription</a>
    posted at 08:00 p.m. on 06-10-2017
  • hyJ4a6 <a href="http://wikctqxgkndx.com/">wikctqxgkndx</a>, [url=http://nrkvivvezwep.com/]nrkvivvezwep[/url], [link=http://ybisgsdrfqck.com/]ybisgsdrfqck[/link], http://cayqumfbwtze.com/
    posted at 11:26 a.m. on 12-11-2016
  • 9gG1Eo <a href="http://vlzchgssjewo.com/">vlzchgssjewo</a>, [url=http://frqunbbpsbfr.com/]frqunbbpsbfr[/url], [link=http://gkxxozlvfsth.com/]gkxxozlvfsth[/link], http://asvjnwzoigsr.com/
    posted at 07:02 a.m. on 08-13-2016
  • jKZz0g <a href="http://kbigbtwjudsb.com/">kbigbtwjudsb</a>, [url=http://frbqxvxjjril.com/]frbqxvxjjril[/url], [link=http://llhydwviwast.com/]llhydwviwast[/link], http://gyzvyuutcqag.com/
    posted at 02:06 a.m. on 07-04-2016
  • This info is the cat's <a href="http://rlnmegsk.com">paasjma!</a>
    posted at 03:14 p.m. on 04-16-2016
  • Well done arictle that. I'll make sure to use it wisely.
    posted at 09:18 p.m. on 04-15-2016
  • How do I run this in Linux terminal? Neither ./Battle_ship or ./Battles_ship.exe works.
    posted at 04:43 p.m. on 01-24-2016
  • This code left me dumbfounded... I was like ok, so still in my first c programming class but I am certain I could do this in under 1000 lines. So I did (with error handling and a few other enhancements) http://www.cprogramming.com/source/Battleship.zip
    posted at 11:40 p.m. on 11-04-2014
  • Worst piece of code I've ever seen. This simple game could be written in less than 1000 lines using 2D array and loops with all kinds of error check. I think you should NOT even touch any kind of programming since your logic is flawed everywhere.
    posted at 10:07 p.m. on 04-21-2013
  • Y
    posted at 08:01 p.m. on 11-29-2012
  • #include <iostream> #include <cmath> using namespace std; int main() { int test,i,n,m,temp,c; short int a[10000]; for(c=0;c<10;c++){ cin >> test; for(i=0;i<test;i++) { cin >> n >> m; a[i] = n-m; } temp = a[0]; for(i=0;i<test;i++) { if (abs(a[i]) >= abs(temp)) { temp = a[i]; } } if (temp<0) cout << 2; else cout << 1; cout << " " << abs(temp); } }
    posted at 06:49 p.m. on 01-25-2012
  • BXkxuQ <a href="http://gwiphkiafrox.com/">gwiphkiafrox</a>
    posted at 07:47 a.m. on 01-06-2012
  • OxfsOY , [url=http://tesytkwswkai.com/]tesytkwswkai[/url], [link=http://wffzlpcjefrz.com/]wffzlpcjefrz[/link], http://ufjqmwbsqelf.com/
    posted at 08:19 a.m. on 01-04-2012
  • hmoj3o <a href="http://asgnbvxhlqqi.com/">asgnbvxhlqqi</a>
    posted at 03:58 a.m. on 01-04-2012
  • Boom shaakklaa boom boom, problem solved.
    posted at 06:05 a.m. on 01-03-2012
  • wow! alot of reviews hating this program. only thing missing is the haters links to something workable that they have done better. For an educational site, seems alot of tearing down and little assistance learning... you know better? show us. i love learning from bad mouthed hecklers as much as other sources if their info is where there mouth is.
    posted at 12:41 p.m. on 09-18-2011
  • review *
    posted at 08:28 a.m. on 09-15-2011
  • Give unavailable position = game act weird, error prevention needed.
    posted at 01:16 a.m. on 08-11-2011
  • dud i had made a submarine game as a practice it took about 600 lines and it had chekings for everything!!! i will post it soon as a "currection" if that's the word for this thing
    posted at 01:35 p.m. on 06-24-2011
  • Just when you thought epic failing was bad. This just broke that limit and beat it by 911x...
    posted at 12:51 p.m. on 05-31-2009
  • Its funny to look at the spelling and grammar of the people bad-mouthing the spelling in the code. For example "Oh my god!!, what money(monkey?) programmed this.(should be a question mark maybe) Have u(spelling) enever hurd(spelling) of fuctions (spelling) to repeat tasks(comma) not writing out each event. plus (capitalise) there is no error checkinh (spelling) & you cant(apostrophe pleae) spell. u(it's 'you', just two extra letter PLEASE) cock monkey.
    posted at 03:42 p.m. on 03-30-2009
  • Froze my computer =(
    posted at 05:15 p.m. on 07-11-2008
  • The app is a little hard to follow. The source isnt exactly clear, so there could be more comments to tell why we do this or that.
    posted at 06:49 p.m. on 12-04-2007
  • Back when I first started programming, (with Visual Basic) I used to write code like that. My instructor used to get pissed at me because he couldn't read my source code, but it worked perfectly. Give the guy/girl a break. Assholes.
    posted at 11:32 p.m. on 07-17-2006
  • Clearly everyone here flaming the program, are actually pith no clue as the what is going on, and the people standing up for this guy are actually honest people with common sense. I mean, since when were people writing books flamed for writing simple programs in them, and since when was it a bad thing to copy these , and make your own , even if knowledge is limited.
    posted at 02:17 p.m. on 06-03-2006
  • Ok, some harsh reviews, but clearly the person is new to programming, I wouldn't know where to start writing a program like this, (maybe learning the rules of the game), and yes I could see a definite need for functions. The thing that I find bad, is the lack of comments mostly. -this game obviously has no error checking or anything built in, and with a gizillion switches and cases, I really can't be bothered learning what the hell is going on. I'm slightly dissapointed that this site doesn't have example code to learn from, and people have to post their beginning stuff!
    posted at 05:06 p.m. on 04-09-2006
  • good for noobs trying to learn C++
    posted at 12:13 p.m. on 06-12-2005
  • Now, from reading all the previous reviews I naturally assumed people were being a bit OTT, and needlessly harsh. But after looking at the code... whilst I'm certainly not advocating the personal insults that have been flying around, I've got to say that the code itself is dire. I have honestly never seen as many needless switch statements before- there must be over a thousand of them. Had you considered the possibility of a more straight-forward implementation- without relying on repetitive logic blocks? Additionally, a lot of the data-checking which is needed to make the game playable has simply been skipped out. Next time you write a program, sketch the basic structure of it out on paper first- and if you can't do that without wanting to use copy-and-paste, there's something wrong with your design.
    posted at 05:07 a.m. on 04-13-2005
  • Srry about the code being crapy. Im working on one with graphic in open gl. It was one of my first programs. The new one sould be poster soon.
    posted at 04:17 p.m. on 03-14-2005
  • Heheheh... Maybe the execution file and .cpp file he included in nice little package came from different sources? Maybe the guy is smarter than some of use would presume... I would write some bullshit long source , and put it in the zip, but then write a normal code with trojan in it... to compensate a gap?
    posted at 12:28 a.m. on 11-10-2004
  • This is horrible. You can not spell 'position', the interface is horrible, you can't tell what you're doing, and the source is too large. Not even Microsoft would make a program that long and cofusing.
    posted at 10:39 a.m. on 07-06-2004
  • Why is the code so long? You shouldn't make a program that you don't know how to make. To tell you the truth, I think it's a very bad program and it's a shame that people will see it and think that's the way you're supposed to make programs. BTW Learn to spell correctly (Here's a translation for you if you didn't understand me: Leran ot psell)
    posted at 07:44 p.m. on 04-29-2004
  • Ok. I'm new at C++, barely know anything. Probably couldn't even make that game you made. But what are you thinking with all that code!?!?!? Even I know there's ways to make it shorter and easier. Although I'm not new at programming, just C++. But christ man. Every time I try to open the source file, the damn program freezes. I think you should fix it, and repost it.
    posted at 06:12 p.m. on 12-17-2003
  • Oh my god!!, what money programmed this. Have u enever hurd of fuctions to repeat tasks not writing out each event. plus there is no error checkinh & you cant spell. u cock monkey
    posted at 08:05 a.m. on 08-29-2003
  • oh, and learn how to spell, people like you should not be allowed to use C++.. (Do you work for microsoft? way too much code to do a simple thing)
    posted at 11:48 p.m. on 08-14-2003
  • How stupid do you have to be to write out 28294 lines of code that dont even work well. Your interface is unclear, your ship entry lets you place multiple ships on top of each other and the list goes on.. You might as well check your code before you put crap like that on the internet
    posted at 11:46 p.m. on 08-14-2003