18 lines
354 B
Mojo
Generated
18 lines
354 B
Mojo
Generated
def cache_lookup(sensor_id: Int) -> Int:
|
|
if sensor_id == 7:
|
|
return 512
|
|
return None
|
|
|
|
|
|
def main() raises:
|
|
var hit = cache_lookup(7)
|
|
var miss = cache_lookup(3)
|
|
if hit:
|
|
print('hit:', hit.value())
|
|
else:
|
|
print('hit:', hit)
|
|
if miss:
|
|
print('miss:', miss.value())
|
|
else:
|
|
print('miss:', miss)
|