Skip to content

Instantly share code, notes, and snippets.

@yuitest
Last active August 29, 2015 14:06
Show Gist options
  • Save yuitest/59c4aadaca6378c179ab to your computer and use it in GitHub Desktop.
Save yuitest/59c4aadaca6378c179ab to your computer and use it in GitHub Desktop.
生活感あふれる擬似コード
生活感あふれる擬似コード
なるべく、現状をそのままに書きます。
改善点があればコメントで。
必要に応じて Gist から GitHub に移行します。
when 入眠:
if 次の朝が出社日:
iPhone のアラームを ON
else:
iPhone のアラームを OFF
ensure iPhone が非マナーモード
ensure iPhone が充電中の状態
ensure iPhone の音量が最大
ensure iPhone にイヤホン・ヘッドホンが装着されていない
when 朝:
if 出社日 and 出社日だがまだ 1 時間以上の余裕はない:
# 洗濯乾燥機があれば分岐いらない
return
天気を取得する
if 雨が降る:
# 乾燥機があれば分岐いらない
return
洗濯して干す()
def 洗濯して干す:
洗剤の残量チェック
洗濯物を回収する
if 容量が多すぎる:
洗濯物, 残り = 分割(洗濯物)
TODO に残りの洗濯を追加する
洗濯機を作動させる
洗濯乾燥機が欲しい
-> 置き場がない
-> 引っ越す
-> お金がない
-> 貯金する
引っ越す
-> お金がない
-> 貯金する
@yuitest
Copy link
Author

yuitest commented Sep 27, 2014

脳を整理する。

@yuitest
Copy link
Author

yuitest commented Sep 27, 2014

https://github.com/gennad/Design-Patterns-in-Python/blob/master/null.py
import null

してモック代わりに使った方が厳格になりそう。

Python 3 だと日本語を識別子に使えるし。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment