간단한 유한 상태 머신 구현하기
function Automaton()
{
this.currentState = 'q1';
this.states = [{
Pete, the baker (part 2)
재료를 모두 사용할 수 있는 갯수에 대한 부족분을 계산(? 말로 적으니까 이상한데?)
var recipe = {flour: 200, eggs: 1, sugar: 100};
getMissingIngredients(recipe, {flour: 50, eggs: 1}); // must return {flour: 150, sugar: 100}
getMissingIngredients(recipe, {}); // must return {flour: 200, eggs: 1, sugar: 100}
getMissingIngredients(recipe, {flour: 500, sugar: 200}); // must return {flour: 100, eggs: 3, sugar: 100}
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
https://danielmiessler.com/study/vim/
Verbs are the actions we take, and they can be performed on nouns. Here are some examples:
d
: delete
c
: change
문자열
1 3 +
을 계산
function calc(expr) {
if (!expr) return 0;