Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
openScadでこんなのありますか?
list = [2, 3]; if(1 in list){ echo("in"); }else{ echo("not in"); } /* or better: */ list = [2, 3]; isin = 1 in list? 100 : 0;
このために、組み込みsearch()関数を使用して、結果が空かどうかを確認することができます。
search()
list = [2, 3, 1]; isin = len(search(1, list)) > 0 ? 100 : 0; echo(isin);