apndx / denmaker Goto Github PK
View Code? Open in Web Editor NEWSolo desktop project for Data structures and algorithms lab course at Helsinki Uni. Dungeon generator. Tecs: Java - JUnit - Maven
Solo desktop project for Data structures and algorithms lab course at Helsinki Uni. Dungeon generator. Tecs: Java - JUnit - Maven
Projektin yleinen rakenne on selkeästi jaoteltu omiin komponentteihin mikä näyttää toimivan hyvin. Luokkien vastuut eivät vaikuttaneet olevan liialliset, mutta parin metodin pituutta voi jossain vaiheessa pilkkoa osa-metodeihin. Suurin osa metodien nimistä olivat toimintaa kuvaavia, ja muuttujien nimissä ei ole paljon huomautettavaa (OwnArrayList:in counter -> size oli jo muutettu uudessa commitissa).
1. Yksi testeistä ei mene läpi (voi olla, että on jo korjattu):
2.
char uniChar = '\u2588';
String block = String.valueOf(uniChar);
toistetaan monta kertaa Area luokassa, joten sen voisi siirtää private muuttujaksi ja kertoa kommentilla mikä merkki on kyseessä.
3.
Lisäksi Area luokan parametrillista konstruktoria voisi käyttää parametrittomassa konstruktorissa näin:
public Area() {
this(49, 149)
}
public Area(int areaHeight, int areaWidth) {
this.areaHeight = areaHeight;
this.areaWidth = areaWidth;
this.tiles = new Tile[areaHeight][areaWidth];
this.roomList = new ArrayList<>();
char uniChar = '\u2588';
String block = String.valueOf(uniChar);
for (int y = 0; y < tiles.length; y++) {
for (int x = 0; x < tiles[y].length; x++) {
tiles[y][x] = new Tile(block, y, x, null);
}
}
}
4.
Onko tarvetta kahdelle buildRooms ja addRooms metodille: buildRooms, jolle annetaan lista, ei näytä olevan missään käytössä paitsi yhdessä testissä? addRooms(int attempts) voisi nimetä kuvaavammin, esim. createRooms, koska se generoi mahdollisia huoneita jotka yritetään lisätä Area:an.
5.
Suorituskykytestaus voisi toimia omana luokkana ja tuottaa tuloksia monesta eri koko ja yritys kombinaatiosta niin, että saa hyvän kuvan algoritmin skaalautuvuudesta yhdellä kertaa, ettei tarvitse ajaa testejä monta kertaa manuaalisesti.
6.
Yksikkötestaus näyttää olevan vielä vaiheessa, vaikka kattavuus on hyvä. Tärkeätä on, että kokonaisuus toimii, mutta on hyvä myös testata luokissa yksittäisiä public metodeja joita muut komponentit käyttävät. Näin näkee nopeasti missä on pieni virhe.
Projekti näyttää hyvältä. Toivottavasti suurten alueiden tehokas luominen onnistuu.
Edit: I totally didn't forget to add the date 16.08 02.10.2018
Overall the quality of the code is good. It is portioned well in small sections that are easy to understand. Of course, there are always some long methods that feel, at first, illegible for an outsider. There is also a good amount of classes that all have a distinct role.
I’m not going to say much about the UI, but I think it should ask again if you give a number outside its range, I was pretty confused at the start when it just kept going. The corridors of the maze that are at the very edge look strange. Easiest fix for that is to just add borders while drawing the dungeon, the other option would be to change the algorithm a little.
As you have probably noticed, the walls seem to disappear during buildMaze( ) because of solidifyWalls( ). I would assume it helps you at some point and adding the walls back should be easy as you already have a method for making a room’s walls and a list of all rooms (Though you have to change it a little, so it leaves the opening to the maze). Still I think the best option is to remove solidifyWalls( ), if you can replace it with a few if-statements.
I don’t know what else to say. Your code is cleaner and simpler than the code I write, so I can’t really help you with making any of that better. At the end I will say that "█" comes out as question mark in Netbeans, just in case it somehow works properly for you. We all know the number one excuse for a programmer is “It works on my machine”.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.