CPU allows loops.
use bp's C# -> ZASM program.
Okay, I'm in the process of building an elevator, and I was wondering how I would go about queuing up elevator floors?
For example, I have someone on the 5th floor wanting to go down, someone on the 3rd floor wanting to go up to the 6th floor, and someone in the elevator, at the first floor wanting to go to the 3rd floor.
2 call buttons are pressed, 1 button in the elevator is pressed. Now, the best way I can think of handling this is through 2 expressions and a RAM chip.
1 expression to handle where the elevator is and where it goes next. The other expression to manage the queue. The RAM chip to manage what buttons were pressed and what direction the people waiting want to go.
I'm a programmer, I've been doing it for 3 years. This is driving me insane, because it would be very easy to write in a language like C or PHP, but it's almost impossible without functions and loops in the expressions.
What do you think?
CPU allows loops.
use bp's C# -> ZASM program.
However, this is possible with an expression, it would only eat up your time, and you would need a 64x64 RAM to write down multiple values inside it.
This is the example:
Somebody on the 6th floor presses the button, the elevator goes up, but shortly, somebody on the third floor presses the button while the elevator is moving, The expression has the part scripted, if the elevator is not at set location and still moving, then qeue += 1, and possibly, write the button's value.
Once the elevator is done moving, and a delay chip is set up to open the door + keep the elevator still, once the elevator starts moving again, it would call up the memory from the ram ant that "qeue" adress.
The problem is, this will never be like in real life, as the people who press the button first will get the most priority.
Last edited by Synchro; 07-04-2008 at 05:24 AM.
In reality there are a series of different systems. Eg, sometimes if an elevator is going up, and someone pushes the up call button, it'll stop and grab em, where if they are pushing down, it;ll wait till its on its way back down. Thats just the basic gist, not even, from my experience with elevators.
Bookmarks