Új hozzászólás Aktív témák
-
Sziasztok!
Kaptam egy teszt feladatot, TicTacToe. A Consultant interface-t kell implementálni, igazából 1 függvény van benne összesen, ami egy adott állás alapján javasol egy lépést, majd azt az értéket visszaadja. Azon gondolkodtam, hogy itt érdemes még létrehozni külön függvényeket (pl. checkForWin, checkForDraw, stb.), vagy elég a suggest függvényen belül implementálni az egész logikát? Ti mit várnátok el, hogy elegáns? Gáz, ha minden azon az egy függvényen belül van, jobban "OO-sítani" kéne?
Az van a leírásban, hogy a meglévő kódon már ne változtassak, de ha a YourConsultant osztályon belül még létre akarnék hozni plusz függvényeket, akkor elegáns lenne először az interface-t módosítani, de ezt elvileg nem akarják. Ezért is gondolom, hogy a suggest függvényben elég lenne megoldani az egészet.
Please advise

public class YourConsultant implements Consultant {
@Override
public CellLocation suggest(GameBoard gameBoard) {
// TODO Auto-generated method stub
return null;
}Leírás:
The goal of this exercise is for you to create an implementation of the
Consultant interface. You can use the provided class YourConsultant that needs
to be finished. We will run your solution against our unit tests. The source
and unit tests for this project may be found in the zip file associated with
this file.
Please read the JavaDoc carefully.
Keep in mind that:
* We are only interested in an implementation for the Consultant interface. We
do not, for instance, want an application that can interact with other
(human) players. We do not expect any kind of GUI, nor do we expect a class
with a main method.
* We are not so much looking for a solution that performs very fast. If your
implementation finds the best solution within a second, that is good enough.
* We are interested in the readability of your code.
* Follow the instructions carefully, but keep it simple! Your solution might of
course require more files (Java types), be careful however not to
over-engineer your solution.
* You are not allowed to change existing code, i.e. do not change existing
files.
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- ASUS PRIME B460M-A R2.0 - OEM, Magyarul se doboz, se io shield, se semmi. CSAK A LAP
- Intel Core I5 10600K - 4.8Ghz Turbó Foxpost Az Árban
- Amd Wraith Prism Processzor Hűtő - AM4 Teljesen Új
- Iphone 14 Pro Független 128GB & 100%-os új gyári akksi HIBÁTLAN
- Intel Core i9-9900KF 8-Core 3.6GHz (16M Cache, up to 5.00 GHz) Processzor!
- Eladó 1db Nokia steel hr hibrid okos óra dobozával
- GYÖNYÖRŰ iPhone 13 Mini 128GB Midnight - 1 ÉV GARANCIA -Kártyafüggetlen, MS4071
- GIGA AKCIÓ! Lenovo ThinkPad P15 Gen 2 Intel i7-11850H 32GB 512GB Nvidia RTX A4000 1 év garancia
- Xiaomi Redmi 14C / 4/128GB / Kártyafüggetlen / 12Hó Garancia
- BESZÁMÍTÁS! ASRock H510M i5 11400F 16GB DDR4 1TB SSD RTX 3070 8GB Zalman S2 TG GIGABYTE 750W
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest


