AbdulDevHub / AbdulDevHub/Exceptional-University-Projects

[Shadow In The Dark] Address TA Commentary

Aperta
#6 0 commenti 0 reazioni 1 assegnatario Rivendicata da @AbdulDevHub Vedi su GitHub
Type: Bug
Lingua principale
Jupyter Notebook
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Points starting with '+' means the feature works. '-' means the feature does not work.

Base requirements: 5/6: All base features are implemented correctly. Algorithm chosen to generate random number was cited.

+ Program runs successfully
+ Game map generated
+ Character, monster, candle and match placed randomly
+ Reads input from console to move the character in 4 directions
+ Shadow monsters chase after the character
+ Shadow monters increase the fear gauage (and is printed)
+ Shadow monters respawn
+ Character doesn't walk through walls
+ Character doesn't light up candle before picking up a match
+ Message when lighting up candle
+ Message when fear guage increases
+ Message when fear guage reaches 100
+ Restart game function
+ Does not use a large static array for the grid, which wastes memory
+ Variable grid sizes

+ Random number generation algorithm is cited.

- Your game crashes under some conditions. The shadow can only spawn in two positions on the map. If the players is near both spawning positions, the shadow fails to spawn and the program enters an infinite loop. Also, this is always the case in a 5x5 map and the player stands in the center, so you probably shouldn't allow 5x5.
- The reason the monster is only spawning in two locations is probably because your RNG is because you chose bad constants. Did you read the paper you cited? It suggested the constants a = 16807; m = 2^31 - 1; c = 0. Using these constants do not cause the bug.

Enhancement: 1/2 Unlimited Undo

- Does not use the program stack. You allocated static space for the undo buffer. Because the space for the undo is limited, it technically cannot be unlimited.
+ Undo works

Enhancement: 1.5/2 Multiplayer

+ Uses sbrk to allocate memory
- (0.5) Missing sbrk deallocate. This is not possible to do on CPUlator. (See https://piazza.com/class/meje9p8ug6a1b3/post/104_f2)
+ The leaderboard is sorted

Notes on `sbrk`:

CPUlator also appears to not consider the size of the memory the code wants to allocate -- no matter what values given, I'm getting the addresses 0x2888 0x5110 for the two arrays you want to allocate.

So on CPUlator, we could replace the syscall with "li a0, 0x2888" and "li a0, 0x5110". This is a problem if there are more than 10376 players. However, this is more of an issue with CPUlator's lack of implementation than your code.

You were supposed to allocate on the stack, but the pattern for allocating on the stack is similar in that you need to store a pointer to the allocated array in static location in memory, so we're accepting your solution.

However, because you can't deallocate or manage the memory in CPUlator, we're deducting 0.5 marks, since you can't manage the memory like you can on the stack.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.