Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "dus..."
*talking to a customer on the phone*
*tries to switch to the next virtual desktop for a terminal*
*BAM BLACK SCREEN*
*wild Linux mint logo appears*
*realize that I pressed ctrl+alt+delete*
*explains honestly to colleagues and client*
Both found it funny and laughed, luckily 😆13
My first self written framework 😅
Damn that was a pile of ****, I still write my own stuff (frameworks etc) but I've learned a lot and those are way better compared to that first one.
Everything was static, loads of defines (way too fucking many) and so on.
Flashed an arch iso to my new raspberry pi 3, followed instructions for how to install yaourt from a decent site with good instructions...
...aaaaaand pacman is broken.
Reflashing the sd card now 😬12
I am currently busy with a project for a university module where we have to create a computer based implementation of the original Cluedo board game that can be played with 4 to 6 players over a network. My main responsibility is the network, but due to my love for data structures I volunteered to create a class that implements the actual game board as a graph in order to provide pathfinding for our AI player as well as validation for moves and paths of players playing the game. In the original project description all players started on their own tile, but this was changed recently.
Dus to the original specification and due to the rule that a player may not move through the center room, I simply made that the center room only has a path to it, not from it (thus no children in the graph node). When the project changed I forgot about this and we started getting errors that the server says a move is invalid everytime the game starts, because naturally the pathfinding says that the distance of any path from the center room is infinite and thus (distance > playerDiceRoll).
We quickly needed a work around, without changing everything or the structure of the graph, due to the face that a player shouldn't move through the center. My solution to this was that in the validate move function, I simply check whether the player is in the center room and then return whether a move from any of the for exit blocks from the center to the desired destination with the current dice roll value is valid (because moving to any block from the center a human player would take the shortest path, using the exit closest to their desired destination.
My result code was basically:
if (in center && target != destination)
return validMove(exit1, destination, rollValue) || validMove(exit2, destination, rollValue) || .......;
My friends immediately didn't think it will work, but I sat there with a smile and compiled my code with full confidence. Their faces were priceless!