컴퓨터 공학

마음이 정화되는 소스코드

혼새미로 2019. 4. 6. 10:34
반응형
#include <cstdio>
void makeAndEatRamen() {
   printf("라면을 만들어 먹는 작업을 시작합니다.\n");
   auto boilWater = [&]() {
       printf("냄비에 물을 끓이는 작업을 시작합니다.\n");
       auto preparePot = [&]() {
           printf("냄비를 준비합니다.\n");
       };
       preparePot();
       auto turnOnFire = [&]() {
           printf("가스레인지에 불을 붙힙니다.\n");
       };
       turnOnFire();
       auto waitUntilBoil = [&]() {
           printf("냄비의 물이 끓을 때 까지 기다립니다.\n");
       };
       waitUntilBoil();
       printf("냄비에 물을 끓이는 작업을 완료하였습니다.\n");
   };
   boilWater();
   auto putRamenIntoPot = [&]() {
       printf("냄비에 라면을 넣는 작업을 시작합니다.\n");
       auto putNoodleIntoPot = [&]() {
           printf("냄비에 라면사리를 넣습니다.\n");
       };
       putNoodleIntoPot();
       auto putSoupIntoPot = [&]() {
           printf("냄비에 라면스프를 넣습니다.\n");
       };
       putSoupIntoPot();
       printf("냄비에 라면을 넣는 작업을 완료하였습니다.\n");
   };
   putRamenIntoPot();
   auto eatRamen = [&]() {
       printf("라면을 먹는 작업을 시작합니다.\n");
       auto prepareBowl = [&]() {
           printf("라면을 담을 그릇을 준비합니다.\n");
       };
       prepareBowl();
       auto putRamenIntoBowl = [&]() {
           printf("라면을 그릇에 천천히 담습니다.\n");
       };
       putRamenIntoBowl();
       auto startEatRamen = [&]() {
           printf("라면을 먹습니다.\n");
       };
       startEatRamen();
       printf("라면을 먹는 작업을 완료하였습니다.\n");
   };
   eatRamen();
   printf("라면을 만들어 먹는 작업을 완료하였습니다.\n");
}
void main() {
   makeAndEatRamen();
}
반응형