Source code -

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 /
resource information
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.
Current Rating 4.11627906976744
Rate Resource
Number of Reviews 51
Review this Resource
  • personal loans online <a href="">unsecured personal loans</a> loans payday <a href=>unsecured personal loans</a>
    posted at 10:47 p.m. on 01-21-2018
  • argumentative essays <a href="">argumentative essay</a> writing homework help <a href=>paper writing</a>
    posted at 04:07 p.m. on 01-14-2018
  • cash loans no credit check <a href="">cash loans</a> cash now <a href=>cash loans no credit check</a>
    posted at 01:44 p.m. on 01-13-2018
  • direct payday loan lenders <a href="">short term payday loan</a> payday loan online <a href=>fast cash loans</a>
    posted at 12:10 a.m. on 01-13-2018
  • short term loans direct lenders <a href="">easy online payday loans</a> short term loans direct lenders <a href=>short term loans direct lenders</a> quick cash loan <a href="">easy payday loans</a> internet payday loans <a href=>small payday loans</a> help on my math homework <a href="">research writing</a> research essay <a href=>research report</a> direct lenders payday loans <a href="">direct payday lenders online</a> online payday loans direct lenders <a href=>payday advance</a> payday loan direct lender <a href="">payday loan direct lender</a> payday loan direct lender <a href=>payday loans online direct lender</a> easy payday loans online <a href="">the best online payday loans</a> payday loan <a href=>best payday loans online</a> payday loans online <a href="">payday loans online</a> fast online payday loans <a href=>online cash advance</a>
    posted at 12:30 a.m. on 01-12-2018
  • cash loans <a href="">cash advance</a> online payday advance <a href=>online payday advance</a>
    posted at 03:48 p.m. on 01-11-2018
  • auto insurance quotes <a href="">cheap auto insurance quotes</a> auto insurance company <a href=>cheap auto insurance quotes</a>
    posted at 02:07 a.m. on 12-25-2017
  • best websites for essays <a href=>buy essay</a> help writing essays for college <a href=>order essay online cheap</a>
    posted at 08:01 p.m. on 11-07-2017
    posted at 07:45 a.m. on 10-01-2017
  • <a href=>online payday advance loan</a>
    posted at 01:38 p.m. on 09-02-2017
  • <a href=>buy cialis online</a>
    posted at 10:01 p.m. on 08-31-2017
  • <a href=>cialis online</a>
    posted at 09:42 p.m. on 08-31-2017
  • wh0cd391589 <a href=>Tretinoin Gel</a> <a href=>viagra online</a>
    posted at 11:30 p.m. on 07-22-2017
  • wh0cd171168 <a href=>order diflucan online</a> <a href=>generic for diflucan</a> <a href=>Metformin 500 Mg</a>
    posted at 08:16 p.m. on 07-09-2017
  • wh0cd24220 <a href=>buy ilosone</a> <a href=>cyklokapron</a> <a href=>imdur</a> <a href=>where to buy hoodia</a> <a href=>pilex</a> <a href=>endep</a> <a href=>myambutol</a>
    posted at 03:51 p.m. on 07-09-2017
  • wh0cd441238 <a href=>cephalexin</a> <a href=>generic tetracycline</a> <a href=>buy fluconazole online</a> <a href=>adalat without prescription</a>
    posted at 08:00 p.m. on 06-10-2017
  • hyJ4a6 <a href="">wikctqxgkndx</a>, [url=]nrkvivvezwep[/url], [link=]ybisgsdrfqck[/link],
    posted at 11:26 a.m. on 12-11-2016
  • 9gG1Eo <a href="">vlzchgssjewo</a>, [url=]frqunbbpsbfr[/url], [link=]gkxxozlvfsth[/link],
    posted at 07:02 a.m. on 08-13-2016
  • jKZz0g <a href="">kbigbtwjudsb</a>, [url=]frbqxvxjjril[/url], [link=]llhydwviwast[/link],
    posted at 02:06 a.m. on 07-04-2016
  • This info is the cat's <a href="">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)
    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="">gwiphkiafrox</a>
    posted at 07:47 a.m. on 01-06-2012
  • OxfsOY , [url=]tesytkwswkai[/url], [link=]wffzlpcjefrz[/link],
    posted at 08:19 a.m. on 01-04-2012
  • hmoj3o <a href="">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