
Once
such a booze has gone (respect!), I decided to put my crafts into the opensource - a game of battleship.
The project is hosted on googlecode.
SVN is there. In addition, the
source code and the
Windows build can be taken directly from my home computer (why so - under the cut). Main features:
- written in Qt - it runs anywhere (and only the basic features are used, you don’t have to install any QSvgRenderer)
- has several options for the rules (need more? - write! :-))
- plays fair (that is, when making a move, the computer doesn’t peek into your field)
- automatic and manual placement of ships and other trifles
Actually, this is all that I give to humanity, but ... in return, I hope for some feedback, -)
<upd> Caution - Habreffect! :-)Colleagues! Now with my home computer at the same time there are more than a hundred downloads (more than a hundred connections are served). Downloading the Windows distribution can take 10–20 minutes, not all browsers can handle it :-) Use the download manager, or wait for the habra effect to go down.
I apologize again. I could not expect such a swing. Already more than 1000 downloads :-). Waiting for your comments. Thank!
</ upd><upd2>Poured hastily :-)
You can not take everything from home!SortsiUnder Windows(more than 3000 copies have already been downloaded from home :-) I expected, well, a maximum of 100 :-))
</ upd2>')
<upd3> pfactum reports that it did not collect from Linux for Linux and the problem was solved by adding the line "#include <stdlib.h>" to src / logic / arena.cpp. Apparently, the problem really is the place to be. If someone else has such problems - write.
</ upd3>First of all, thanks for any comments, but some comments will be more precious to me than others :-)
The most important thing for me now to discover
- possible illogic in the program (for example, if you can shoot at the enemy even after the game ends)
- possible typing errors in messages
- Any suggestions that make the message more understandable are accepted.
Well: "the application has no icon." Good: "the word` has' is written in the wrong way. " Such arrangements will be immediately taken into account. Suggestions like “it would be good to rob ships and rape sailors of both sexes” will be considered not earlier than 2012 :-)
Now a few words anticipating the questions.
Will there be builds for my favorite OS?
I have three news: bad, good, and another good.
The bad: I have already created several opensource projects and came to the conclusion that I am not able to maintain current builds for all the OSs alone. For this project, I basically will not lay out the assembly.
Good: I found that there are people for whom it is not difficult to lay out assemblies, packages, ports, builds ... for their favorite OS.
I really hope that this little program will have connoisseurs who will take on the modest work of collecting and uploading binaries. I will gratefully post links to these assemblies on the project website.
In addition, I am sure that users of the appropriate OS and distributions will be able to arrange binarinks in the spirit and style of these OS. For example, what did I do for Windows users? - stupid zip-archive with exe-shnik and necessary dll-kami. And the correct way is probably to make msi, or some kind of installer. To put the binary where it is necessary, to make icons appear, so that the OS knows about the new software and can update it and / or delete it ... I do not know how to do this. And to master this art for everyone and everything ... no - I am not able to. I think that everyone will win if I do not take on the unbearable burden and make clumsy assemblies. Let the professionals take care of this.
And one more good news: for the current version I have assembled a Windows assembly and you can
pick it up from my home machine :-) I am sitting on the stream, therefore (1) the speed of return is not very high, and (2) the connection is broken once a day. I apologize for the inconvenience :-)
What a perversion !? Why not put binaries and sources on the same googlecode?
Well, with binaries, I have a principled position (see above), and the source in the form of an archive will be laid out when the final version 1.0 is released. While you can take them from
google SVN , or
as an archive from my home computer . I just do not want to clog the download section of pre-release versions. In googlecode nothing can be removed from the download section; I don’t want the development options to be kept there forever.
I looked at your code ... it's weird
Oh yeah. In order to at least partially dispel the surprise of those who have looked into the code, I will tell its story.
The era of pearl. A few years ago, I wrote on the knee of the web-based application “Sea Battle”. It was (it is still alive) created on a pearl. The logic included several significant simplifications, which sometimes led to inadequacies, but this could close my eyes. Written and abandoned.
The era of python. Over a year ago, I went to google developers day 2008. Before this case, I decided to try GAE. I didn’t come up with anything new, but rolled the pearl-barley code in Python. I brushed it slightly, slightly cleaned up the protocol of interaction with the server ... But there were no fundamental changes - only a change of language.
The era of python: unrest. It became pleasant to work on the python with the code and I decided to try to do something interesting. (Yes, I forgot to say, GAE did not inspire me, and I abandoned the GAE project; why I didn’t inspire, I can tell you in the comments, but now this is not about it.) I decided to do a six-sided naval battle. Not square cells, but hexagonal honeycombs. To make it convenient to work with cells, I wrote several classes, and the work turned out to be extremely easy. I really liked the ideas underlying this code, they more than met my expectations. But the game was not interesting, the usual sea battle is much more interesting. Therefore, I also abandoned this project.
Qt era. In the summer
of last year, I had to ... in a word, for work, I ran into Qt and I really liked many Qt ideas. I decided to rewrite my Piton hexagonal miracle in a classic Qt / C ++ sea battle. The structure of classes was taken from the Python prototype - there was nothing to invent. All logical "simplifications" that led to a crazy computer game were eliminated. It was fastened Qt and GUI.
Now we have what we have.All logic is written as an independent library. It does not require either Qt or even STL. However, here the classes are pushed through the files most strangely. And in some places, the code requires a "C-plus-plus-pisation" :-) This is related to the Piton history of this code.
The entire GUI is written in Qt. Here, memory management is completely at the mercy of the Qt-mechanism, all are ruled by signals. If you want to rewrite the GUI, it is very easy to do! Enough to support the processing of a few signals.
In addition, there is a Qt-class that controls the course of the game. It stores the state of the game, receives signals from the user and transmits them to the GUI. Strictly speaking, it would be a bit simpler if this class were split into two ... but it would be more correct to use the state machine ... well, in general, and there is something to correct :-)
That's all. Every single detail of this device stores some historical rudiments and / or traces of hasty and not very neat writing. However, everything together is arranged quite harmoniously, and if I have courage, I will slowly rewrite everything. However, now we have a completely working version of the program. I would like to lay it out
- please people now
- understand, and whether it is necessary to refine something else, or to abandon this project, like all its predecessors.
All success in the fight against artificial intelligence in the sea! :-)