Level 5: Encapsulation

In this section, you will find a step by step to use the formula encapsulation concept.

Objective

Create a formula on Ritchie that will encapsulate another formula inside it.

You'll find all the informations you need in the how to encapsulate formulas tutorial section.

The idea is to encapsulate the rit demo coffee-go formula inside the Hello World formula template.

Command suggestion: rit encapsulate coffee

Inputs

In this challenge, it's up to the user to define which inputs he needs. There are many options:

  • Hello Word template inputs + Coffee formula inputs.

  • Only the Hello World inputs.

  • Only the Coffee formula inputs.

  • No input at all.

Step by step

The formula needs to follow the next steps:

  1. Print (at least) the Hello World message of the template formula.

  2. A message informing the beginning of the encapsulation.

  3. The execution logs of the encapsulated formula (rit demo coffee-go)

  4. A message informing the end of the encapsulation.

Improvement suggestions

If you want to play a little more, here are some suggestions:

  • Code a formula which encapsulate more than one formula.