DrakonHub logo

The Drakon Language in Simple Examples

Home

Vegetable Salad

A simple sequence of actions for preparing a vegetable salad:

  1. Wash the vegetables.
  2. Chop the vegetables.
  3. Add the dressing.
  4. Mix the vegetables.

Going to Work

If it is not raining, go to work by bicycle.

If it is raining, you should take the bus so you don’t get wet.

The Knight at the Crossroads

A knight rode up to a fork in the road, and at the fork there was a stone marker.

Go left — you will lose your horse. Go straight — you will lose your life. Go right — you will be married.

Articles in English

If we are talking about a specific object, we use the definite article THE, even if there are several objects.

If we are talking about something we cannot point to, and there are multiple objects, the article is omitted.

If there is one abstract object and it is countable, we use the indefinite article A.

If the abstract object is uncountable, the article is omitted.

Weight Training

Lift the weight until you get tired.

Note that you will lift the weight at least once (and possibly more).

This is a DO-WHILE loop.

Eating Donuts

Eat donuts until you are full.

If you are not hungry from the start, there is no point in sitting down at the table.

This is a WHILE loop.

Painting a Fence

To paint a wooden fence, you need to paint each board one by one.

This is a FOR loop (foreach).

Lunch Break

Main stages of a lunch break

The lunch break is divided into three stages:

  1. Talk with colleagues.
  2. Have a snack.
  3. Get ready for work.

Talk with colleagues

Discuss three topics, one after another:

  1. weather;
  2. sports;
  3. news.

Have a snack

At this stage, we eat pirozhki until we are full. As soon as we are satisfied, we finish the "Have a snack" stage and move on to "Get ready for work".

The "Have a snack" stage is a so-called branching loop, that is, a loop controlled by silhouette branches.

Scientific Method

The scientific method is an approach to explaining problems. Its scientific nature lies in following the prescribed steps. If a researcher violates these instructions, it is not science.

First, a hypothesis is formulated to explain the problem.

Then conclusions are derived from the hypothesis.

The conclusions are compared with facts in such a way that other researchers can reproduce the process.

If the conclusions match the facts, the hypothesis is considered correct.

Washing Machine Operation

According to this program, the washing machine performs the following actions:

  1. Washing with detergent for 20 minutes.
  2. Rinsing for 2 minutes.
  3. Draining the water.
  4. Pause for 3 minutes.
  5. Spinning for 10 minutes.

Vegetarian Beetroot Soup

Preparing vegetarian soup consists of two stages: separate preparation of components and then combining them.

During the separate preparation stage, the following components are prepared simultaneously (in parallel):

Feedback and support

drakon.editor@gmail.com

Privacy policy