EasyPro challengePython

Facade

PythonDesign PatternsStructural

Facade gives a simple, single entry point in front of a complex
subsystem, so callers don't need to know how the pieces fit together.

CPU, Memory and HardDrive each expose low-level operations.
Implement ComputerFacade.start() to sequence the correct boot steps and
return them, in order, as a list.

solve(n) calls start() n times and returns each resulting sequence
(verifying the facade is deterministic and repeatable).

Sample tests

Test #1Zero starts
Input: [0]
Output: []
Test #2Single boot sequence
Input: [1]
Output: [["cpu.freeze","memory.load(0, hdd.read(0, 1024))","cpu.jump(0)","cpu.execute"]]
Test #3Repeatable across multiple calls
Input: [2]
Output: [["cpu.freeze","memory.load(0, hdd.read(0, 1024))","cpu.jump(0)","cpu.execute"],["cpu.freeze","memory.load(0, hdd.read(0, 1024))","cpu.jump(0)","cpu.execute"]]