Industrielle styresystemer - Wiki
Both The Three Way And Two Way valves will look the same code vise. The difference is in how they operate, but for implementation they will look identical.
Lets start by identifying the required inputs and outputs:
INPUTS:
OUTPUTS: