Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
pico menu
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
menuTree={"Main": {"Options":["Sensor 1","Sensor 2","Heater 1","Heater 2","Mixer","Pressure"],"Position":0}, "Sensor 1":{"Options":["View","Calibrate","Set actions"],"Position":0}, "Sensor 2":{"Options":["View","Calibrate","Set actions"],"Position":0} } def printMenu(title,action): if menuTree[title]: print(title) if action=="up": menuTree[title]["Position"]=menuTree[title]["Position"]+1 elif action=="down": menuTree[title]["Position"]=menuTree[title]["Position"]-1 elif action=="select": printMenu(menuTree[title]["Options"][menuTree[title]["Position"]]) print(" ",menuTree[title]["Options"][menuTree[title]["Position"]-1]) print(" *",menuTree[title]["Options"][menuTree[title]["Position"]]) print(" ",menuTree[title]["Options"][menuTree[title]["Position"]+1]) printMenu("Main","")
[
+
]
Show input
Absolute running time: 0.17 sec, cpu time: 0.03 sec, memory peak: 8 Mb, absolute service time: 0,29 sec
edit mode
|
history
|
discussion
Main Pressure * Sensor 1 Sensor 2