Fun Stuff > CLIKC

A programming thread!

<< < (22/37) > >>

Pilchard123:
XAMPP

hedgie:

--- Quote from: Pilchard123 on 07 Jun 2014, 07:34 ---It's easy enough to install it on Windows, as well. Only without the Linux bit and with a few language changes too.

--- End quote ---
For a test environment, I could see using Windows.  But I never would think of using it for a production environment.  The only thing I can think of using a Windows server for is Exchange.

pwhodges:

--- Quote from: hedgie on 07 Jun 2014, 17:13 ---For a test environment, I could see using Windows.   But I never would think of using it for a production environment.
--- End quote ---

There's nothing like a good set of blinkers! (I run Apache, Tomcat, PostgreSQL, etc on Windows at work, and the same plus Deluge and Kerio Connect at home.  But I use Open BSD for firewalls).


--- Quote --- The only thing I can think of using a Windows server for is Exchange.

--- End quote ---

I hate Exchange with a passion, though I've been running it for 15 years; it's just that for the user Exchange plus Outlook is still unrivalled by any alternative.

ankhtahr:
Huh. The programming task for this week is actually a lot more complex than I expected.

Our task is to model the game Battleships. Given are a ShipType and a Direction enum. We've got a number of methods to implement, and at first I thought it would be a relatively easy task. But the more I look into it, the more modelling decisions I need to make. So far I've got an FieldType[][], which is basically the field, and gets initialised with water in every element. (the size is a parameter of the constructor and can't be changed afterwards, as specified in the task)

Now I'm working on the demanded "addShip" method. I guess it'd be the right decision to create a Ship class, and make every ship an instance of it, so I know, which fields belong to which ship and don't have to iterate over the whole array to find out whether there are still ships left. I'm thinking about saving direction and starting point of each ship (which are the parameters given to the addShip method), so every ship knows, which fields in the array belong to it.

Any better ideas?

yeah, and I need to be finished with this task tomorrow at 13:00.

Edit: and once again I'm not allowed to use anything but Java.lang

ankhtahr:
argh. Accessing multidimensional object arrays without making them public sucks. Especially if you can't use java.util.

Array.copyOf and things like that could be useful here, but I have to do everything by hand.

Maybe I'll even do a setVerticalLine/getVerticalLine and setHorizontalLine/getHorizontalLine…

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version