Programming AI with Language · scripted
Practice
What students will do
Guide students through two small programs on a shared screen. In both parts, each student decides what their program does. The examples below are for the teacher to show, not for students to copy.
- Part 1 · One program, different inputs. Each student writes one instruction of their own design, then feeds it several inputs. The program stays the same; the input changes. Then they update the program in the middle of the conversation.
- Part 2 · Turn material into a quiz. Each student writes a program that turns material they provide into a quiz whose rules they choose.
Notes for teachers
Do this together on a shared screen. At every step, ask what the program should do before anyone writes the next instruction. Keep the instruction and the information it processes in separate messages.
The point of the exercise is student agency. Students must write their own instruction, not copy the examples. If a student is stuck, show the list of ideas in Part 1 and ask which one they would want to try, then have them write it in their own words. Remind students not to enter private information.
Part 1 · One program, different inputs
Each student writes one instruction that tells AI what to do with any list they give it. Then they send several lists without changing the instruction.
Ideas for what the program could do
Show this list to students as a starting point. Each one is a kind of program, not a prompt to copy. Students should choose their own and write it their own way.
- Tell me which item in the list does not belong, and why.
- Tell me whether the order I put the list in is right or wrong, and make the strongest argument you can either way.
- Rank the items from most to least useful for a purpose I name, and explain the ranking.
- Tell me the one thing all the items have in common that is not obvious.
- For each item, tell me one thing I probably do not know about it.
- Turn the list into a question a game-show host would ask.
Here are two sample conversations a teacher can show. Each one starts with the instruction alone, then sends inputs as separate messages.
Whenever I give you a list, tell me which item does not belong and why. Do not add or remove items.
Understood.
Nashville, Memphis, Knoxville, Atlanta
Atlanta does not belong. Nashville, Memphis, and Knoxville are all cities in Tennessee. Atlanta is in Georgia.
hammer, screwdriver, wrench, nail
Nail does not belong. A hammer, a screwdriver, and a wrench are tools. A nail is a fastener that one of those tools is used on.
Whenever I give you an ordered list, tell me whether the order is right or wrong and give the strongest argument you can for the order I gave. Keep it under 80 words.
Understood.
Best college football teams: 1. Vanderbilt, 2. Alabama, 3. Georgia
On overall results, this order is wrong: Alabama and Georgia have far better records and many more championships than Vanderbilt. But on head-to-head results it can be defended. On October 5, 2024, Vanderbilt beat Alabama 40–35 while Alabama was ranked No. 1, and one week earlier Alabama had beaten Georgia. If the team that beat the team that beat the other team ranks highest, the order stands.
Fastest ways to get across town: 1. walking, 2. bus, 3. bike
Wrong for most trips: a bike is usually faster than walking, and a bus is faster than both on a long route with few stops. The order can be defended for a short trip in heavy traffic. Walking has no stops and no waiting, a bus can sit in traffic and at each stop, and a bike may be slowed by the same traffic. For a ten-minute trip downtown at rush hour, walking can win.
In each conversation, the first message is the instruction. Every message after that is input, and AI applied the same instruction to each one.
Step 1 · Design the program
- 1Have each student decide what their program will do with a list.They can start from the list of ideas above or invent their own. Their instruction must be written in their own words. Do not let students copy a sample conversation.
- 2Have each student write the instruction so it applies to the future.It should begin with language such as “Whenever I give you a list…” or “From now on, when I send you a list…”. It should not contain a list yet. The list comes next, as a separate message.
- 3Send the instruction by itself, as the first message of a new conversation.
- The first message was the program. What will the next message be?
- What should AI say back to the first message, if anything, before it has any input?
Step 2 · Send different inputs
- 1Have each student choose something they know well.A sport, a game, a band, a hobby, a kind of food, a place they have been.
- 2Have each student make a list of four or five items from that topic.Players, songs, tools, dishes, places, cars, whatever fits.
- 3Send the list as a separate message.Then send at least two more lists without changing the instruction. Read the responses and check that AI did what the instruction said each time.
- The program stayed the same. The inputs changed. Why did the results change?
- Did AI do exactly what the instruction said? If not, what was missing from the instruction?
Step 3 · Update the program in the conversation
- 1Have each student add one rule or clarification to their program without starting over.For example: a fixed format for the answer, a word limit, a requirement to give a reason, or a rule for what to do when the list has only one item. The message should make clear it is an update, such as “From now on, also…” or “Change the rule: …”. Here is an example update a teacher could show.
- 2Send one of the same lists again.Do not change the input. Compare the new response with the earlier one for that list.
- The input stayed the same. What does the program now control that it did not control before?
- Look at every message you sent in this conversation. Which ones changed the instructions, and which ones were input?
Part 2 · Turn your material into a quiz
Now each student writes a different program. This time, the input is material they provide, and the output is a quiz whose rules they specify. The conversation has two messages. The first message is the quiz instruction. The second message is the material. Students write the instruction first, then choose and send the material.
Step 4 · Write the quiz instruction
- 1Have each student write the quiz instruction.It should tell AI to wait for material, then make a quiz using only that material.
- 2Have them choose how many questions they want and what kinds.
- 3Have them explain the format they want.How to number the questions, how to label answer choices, and where to put the answer key.
- 4They may add one more rule.For example, making the questions easy, medium, or hard, or using only facts stated in the material.
- 5End the instruction by telling AI to say "ready" and wait for the material.Here is an example quiz instruction a teacher could show. The number and question types in it are choices, not requirements; students should choose their own.
Step 5 · Choose the material
- 1Have each student choose a short piece of material they want to know well.A section of the driver’s manual, the rules of a sport or a card game, the safety card for a tool, a recipe, or a page of notes from a class.
- 2Keep it separate from the instruction.The material is the input; it is not part of the instruction. It goes in its own message, sent after AI says ready. Here is an example a teacher could show.
Step 6 · Run it and check the result
- 1Send the quiz instruction as the first message of a new conversation.AI should reply with "ready" and nothing else.
- 2Send the material as the second message.
- 3Check the result against the rules.Count the questions. Check the question types, numbering, choices, and answer key. Check that every question can be answered from the material alone.
- Which message was the program, and which message was the input?
Step 7 · Change one rule
- 1Have each student change one rule in the same conversation.For example, change the number of questions, switch to all short-answer questions, or add difficulty labels. Here is an example update a teacher could show.
- 2Send the same material again as a new message.AI should produce a new quiz from the same material under the changed rules.
- The material stayed the same. What changed the quiz?
- Was the message in Step 7 an instruction or an input? How can you tell?
What to look for
By the end of the practice, each student should be able to do the following. Watch for these as you move around the room or read what students share.
- Write instructions for future behavior. The student’s first message uses language such as “whenever I give you…” or “from now on…” and contains no input. The instruction and the input are in separate messages.
- Provide input in follow-up messages. The student sends several inputs, one per message, and sees AI apply the same instruction to each one without being told again.
- Update the program mid-conversation. The student sends a clarification or a new rule, then sends input again, and the response follows the updated instruction.
- Tell the two kinds of messages apart. Given any message they sent, the student can say whether it changed the instructions or provided input.
If a student can do all four, they understand what it means to program AI with language. If a student is stuck on the first one, the usual problem is that the instruction and the input were sent together in one message. Have them split the two and try again.