なんか、会社の先輩にプログラミングの基礎を教えることになりました。
で、「関数」の説明をどうしようかと考えていて、わかりやすくするために料理のレシピに例えて説明しようと考えていたのですが…。
気づけばなんだかよくわからないものが出来上がってしまいました。
※PHPかJavaScript風味の擬似言語です
※関数の意味は適当にご想像ください
※元々関数の説明をするはずだったものなので、すべて関数になっています。
※こちらを聞きながらご覧ください
い~ざ進め~や~キッチ~ン♪
目指すはジャガイモ~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ }
茹~でた~ら♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ boil(potato); }
皮をむい~て♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ peel(boil(potato)); }
グニグニと潰せ~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); }
さあ勇気を出し~みじん切りだほうちょ~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = chop(onion); }
タ~マネ~ギ~目にし~みても~なみ~だこらえて~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); }
炒めようミ・ン・チ~ し・お・コショーで~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER) }
混~ぜたなら~ポ・テ・ト~ 丸くにぎれ~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER); var filling = mix(mashed_potato, sauteed); var fillings = []; while (block = cut(filling, WEIGHT_50GRAM)) { fillings[] = shape(block, OVAL); } }
小麦粉♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER); var filling = mix(mashed_potato, sauteed); var fillings = []; while (block = cut(filling, WEIGHT_50GRAM)) { fillings[] = shape(block, OVAL); } fillings = array_map(fillings, function(block){ return dredge(block, flour); }); }
タマゴに~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER); var filling = mix(mashed_potato, sauteed); var fillings = []; while (block = cut(filling, WEIGHT_50GRAM)) { fillings[] = shape(block, OVAL); } var beaten_egg = beat(devide(egg)); fillings = array_map(fillings, function(block){ return dredge(dredge(block, flour), beaten_egg); }); }
パン粉をまぶして~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER); var filling = mix(mashed_potato, sauteed); var fillings = []; while (block = cut(filling, WEIGHT_50GRAM)) { fillings[] = shape(block, OVAL); } var beaten_egg = beat(devide(egg)); fillings = array_map(fillings, function(block){ return dredge(dredge(dredge(block, flour), beaten_egg), bread_clumb); }); }
揚げれ~ば~コロォッケだ~よ♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){ var mashed_potato = mash(peel(boil(potato))); var chopped_onion = null; do { try { chopped_onion = chop(onion); } catch (tear) { suppress(tear); } } while (!chopped_onion); var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER); var filling = mix(mashed_potato, sauteed); var fillings = []; while (block = cut(filling, WEIGHT_50GRAM)) { fillings[] = shape(block, OVAL); } var beaten_egg = beat(devide(egg)); fillings = array_map(fillings, function(block){ return dredge(dredge(dredge(block, flour), beaten_egg), bread_clumb); }); croquettes = fly_all(fillings, OIL_180_DEGREE_CELSIUS) return croquettes; } croquettes = cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage);
キャ~ベツ~はどう~した~♪
function cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage){
var mashed_potato = mash(peel(boil(potato)));
var chopped_onion = null;
do {
try {
chopped_onion = chop(onion);
} catch (tear) {
suppress(tear);
}
} while (!chopped_onion);
var sauteed = saute(mince, chopped_onion, SALT_AND_PEPPER);
var filling = mix(mashed_potato, sauteed);
var fillings = [];
while (block = cut(filling, WEIGHT_50GRAM)) {
fillings[] = shape(block, OVAL);
}
var beaten_egg = beat(devide(egg));
fillings = array_map(fillings, function(block){
return dredge(dredge(dredge(block, flour), beaten_egg), bread_clumb);
});
croquettes = fly_all(fillings, OIL_180_DEGREE_CELSIUS)
return croquettes;
}
croquettes = cook_croquette(potato, onion, mince, flour, egg, bread_clumb, cabbage);
お粗末さまでした…m(- -)m
※もちろん、実際に教えるときにはもっと分かりやすくやります
コメントする