Quote: Original post by ShadowPhoenixQuote: Original post by SpoonbenderQuote: Original post by ShadowPhoenix
I was thinking of getting 2 bits to represent the room, but it would make the program even slower. The program shall run faster if we use a third bit to indicate if a room is connected or not.
Ok, never mind the number of bits necessary (would be a long discussion, and this probably isn't the place for it)
But I do have a more general question.
Connected to what, do you mean?
Isn't the point that all rooms are connected to all other rooms? (via exactly one path)
So what is there for a room to be connected to?
Can you please explain the number of bits necessary? It sounds COOL!!!
As for the connected part, the faster way of doing it while only wasting 1 byte is to see if the room is in the 'main room'. We only need to have 1 set of room at the end of the moving data, so we only need one bit to see if it in that set or not.
Are you discussion some optimization technique in a beginner workshop? [grin]