Blackjack 1

First, set the browser to Full Screen view, to give this worksheet and your code as much space as possible.

Then choose either one of the two options below:

Option 1: Start this worksheet from scratch

Option 2: Continue, or view, previous work

This worksheet is copyright © Richard Pawson 2025, and protected by the Creative Commons license: Attribution-NonCommercial-NoDerivatives 4.0 International. You may freely make and distribute copies of this worksheet as is, but if you modify this worksheet you may not distribute your modified version (outside your own teaching institution) without the author's permission. Please email the author to report errors or suggest improvements.

Step 1: learning the rules of Blackjack

Watch the first video:

Now and immediately use file > auto save the code to your local file storage: because you will be making changes and want to ensure that your changes are saved.

When you run the program, the display tab will be shown in place of this worksheet, you can flip between them by clicking on the tab headings.

So, run the program now, either:

and play exactly 10 rounds of Blackjack.

Make sure that you have grasped the following points:

After playing 10 rounds, how many points did you, and the dealer, end up with?

If you have not already exited the program, click stop.

Notes

Total hints used: /

Step 2: start to explore the code

Watch the next video:

How many instructions are there in total within the Blackjack program (just find the largest instruction number)?

The initial keyword in an instruction defines the type of instruction. Find and list here at least five initial keywords not mentioned explicitly in the video:

Notes

Total hints used: /

Step 3: the different elements within instructions

Watch the next video:

List below the different colours that you can see being used within the code (they are all shown within the first 15 instructions):

What is the significance of the colour dark-blue, and black?

Notes

Total hints used: /

Step 4: comments

Watch the next video:

Scrolling through the code, find two comments, not including the one at the top showing the Elan version, and write down the instruction number immediately below each comment:

Notes

Total hints used: /

Step 5: identifiers

Watch the next video:

Find five identifiers used in the program - not including any that were mentioned in the video - and list them here:

Notes

Total hints used: /

Step 6: literals

Watch the next video:

Find an example of a literal number, and a literal string - not including any specifically mentioned in the video - and note their instruction numbers below:

Notes

Total hints used: /

Step 7: methods

Watch the next video:

Find five method names - not including any specifically mentioned in the video - and write them here:

Notes

Total hints used: /

Step 8: types

Which of the types mentioned in the video are defined within the standard Elan language (if necessary, watch the video again)?

Notes

Total hints used: /

Step 9: adding a new instruction

Watch the next video:

Your first task is to turn the program into a two-player game (not counting the dealer, played by the computer):

When does the dealer play, now ?

Notes

Total hints used: /

Step 10: modifying an existing instruction

What would happen if you define the second identifier as name2, but in the next line you were to write name1? (If you need to check, run the program)

And what if the the second identifier was still name2 but you used name3 in the following instruction? This time, can you even run the program to try it?

Notes

Total hints used: /

Congratulations! You have completed this worksheet

You have learned:

In the next worksheet - Blackjack 2 - you'll start to do some real programming, by defining and implementing the logic for a fully-automated Blackjack player - and then in the Blackjack 3 worksheet, pitting different automated players against each other for thousands of games, and using the outcome to refine the strategies.

In the meantime, if you have time, we recommend that you watch the following additional videos - that offer further techniques for navigating and editing instructions. Practice the techniques shown in each video, either while it is running, or immediately afterwards.

All the techniques for navigating and modifying instructions may be looked up in the Help tab. For example: show in Help