Skip to content

Instantly share code, notes, and snippets.

View elucian's full-sized avatar
🦎
freelancing

Elucian Moise elucian

🦎
freelancing
View GitHub Profile
@elucian
elucian / switch-function.py
Created August 15, 2019 14:42
Switch simulation using Python functions
#define a value holder function
# => True
def switch(value):
switch.value=value
return True
#define matching case function
# => True or False
def case(*args):
return any((arg == switch.value for arg in args))
@elucian
elucian / main.dart
Last active March 10, 2022 16:00
Dart Switch
import 'dart:math';
void main() {
var rng = new Random();
for (int i = 0; i < 21; i++) {
var v = rng.nextInt(5);
switch (v) {
case 1:
print("v=$v first case");
break;