Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. class IntcodeComputerKeyboardInput:
  2.  
  3.     def read(self):
  4.         return input()
  5.  
  6.  
  7. class IntcodeComputerRawInput:
  8.  
  9.     def __init__(self, inputs):
  10.         self.inputs = inputs
  11.         self.p = 0
  12.    
  13.     def read(self):
  14.         result = self.inputs[self.p]
  15.         self.p += 1
  16.         return result
  17.  
  18.  
  19. class IntcodeComputerQueueInput:
  20.  
  21.     def __init__(self, queue):
  22.         self.queue = queue
  23.    
  24.     def read(self):
  25.         return self.queue.get()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement