needmoreeasy EN 한국어
Learn

04 — Ask: have a conversation

★☆☆☆☆ (1/5)input
Prerequisites
03 — Letters one at a time
You will end up with
a program that asks a name and greets it in a sentence

A program that listens. ask reads what the user types and stores it in a name.

Steps

  1. Type this into the writing box:

    ask name What is your name?
    show Hello name!
    
    run it →
  2. Press Run. The program stops and waits. A box appears below it: type a name and press Answer.

    NME puts the answer it kept into the second sentence, so typing Mina prints Hello Mina!.

  3. The same conversation works in Korean:

    이름을 물어봐 이름이 뭐예요?
    안녕하세요 이름! 말해줘
    
    run it →
  4. For the gentlest first input, an ordinary question is enough — NME infers the name from the question:

    What is your name?
    Hello name!
    
    run it →

Try it yourself

Ask for a city and show it in a sentence:

ask city Which city do you live in?
show I love city!
run it →

What you learned

  • ask name question stores the typed answer as name; 물어봐 is the Korean action.
  • A known name is inserted into a later sentence automatically.
  • An ordinary question like What is your name? also creates the name.
  • show Hello name! prints Hello plus the stored value.

This page on GitHub