Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-rosetta/blob/main/tasks/queue-usage/oracle.py # omega-rosetta aien-dev/omega-rosetta Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-rosetta / tasks / queue-usage / oracle.py` 21 lines ยท 477 bytes Raw Blame History 1 # Independent reference for "Queue/Usage" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 queue = [] 4 def empty(): 5 print("empty:", "no" if queue else "yes") 6 def push(v): 7 queue.append(v) 8 print("push", v) 9 def pop(): 10 if not queue: 11 print("pop from an empty queue: error") 12 else: 13 print("pop", queue.pop(0)) 14 empty() 15 push(1); push(2); push(3) 16 pop() 17 empty() 18 push(4) 19 pop(); pop(); pop() 20 empty() 21 pop()