Skip to contentVarnook
All courses
HollowScriptIntermediate

HollowScript Bridge Project: Market Stall Takings

Check a market stall till roll in three stages: select the paid sales, total takings for each item and find the best seller, then validate a text till roll.

Recommended first: HollowScript: Working with Data. This course builds on it, but you can open it now.

Free to browse. You sign in at the first lesson so your progress is saved.

Free includes 3 learning hours each week, across all courses. If you use them up, running code pauses until Monday at 00:00 UK time; you can still read lessons and edit your code. Longer courses can be spread over several weeks. How weekly limits work.

About this course

HollowScript 0.1.2 preview in WebAssembly

The real HollowScript runtime, a preview release whose details may change, checks and runs your code in the browser. Varnook supplies print, clock and random to every lesson and refuses any other capability a program asks for.

Maintained by Soulstack

Course overview reviewed
Exercise checks verified

Overview review covers the course summary, stated outcomes and final exercise example. Automated verification ran all 3 reference solutions against their checks and confirmed that starter code does not already pass. This is internal verification.

How exercise checks work

What you will be able to do

  • Select paid sales from a list of records and total them in pence
  • Build a map of takings per item and find the best seller
  • Parse text lines into a Result, passing failures on with ? and reporting rejected lines

Put it into practice

What you will make

A checked till roll

The final project exercise rejects bad till roll lines with their line numbers, then reports the accepted count, rejected count and takings. This example accepts 3 lines, rejects 3 and takes £6.80.

Output from the completed course exercise, using its supplied practice data. From Check the till roll.

Line 3 rejected: invalid integer
Line 4 rejected: expected item,pence
Line 5 rejected: negative price
Accepted: 3
Rejected: 3
Takings: £6.80

Syllabus

1 module and 3 lessons. Each lesson is a short read followed by one exercise with checks.

Before you start

Some experience from HollowScript: Working with Data is recommended. Times are estimates; practise at your own pace. Every exercise has checks against its brief.

Read how checks, hints and saved work behave. If something is unclear, report a problem with this course and include the lesson link.