---
title: "reference-book/simorg-in-10-minutes"
source: reference-book
version: genesis-0-1-0
id: reference-book/simorg-in-10-minutes
canonical: /docs/reference-book/simorg-in-10-minutes
---

This is a quick start section, focusing on core functionalities of simorg.
You need to setup your local environment before starting this quick tour. You can follow the instructions in 
$$$ToPageLinker keyword=Getting Started toRoute=/docs/getting-started/introduction$$$ section.


We are going to discover simorg using a simple guessing game. Our application receives user's input from terminal and checks it against a target number. Guessing right leads to a success message, otherwise user needs to enter a new number.

Create a new file and call it <<<guessing-game.art>>>, we will add our simorg code inside this file.

Let's start from the core functionalities by creating two variables.

Using <<<$>>> before an identifier, marks that identifier as variable.

```
$TARGET
$guess
```

Using capital letters we mark <<<TARGET>>> as being a const variable that is being set only once during the lifecycle of our app. Let's give it a default value by replacing line 1 by,

```
3 $TARGET
$guess
```

Simorg doesn't have classical assignment operator <<<=>>> instead it uses dataflows. As soon as our application starts value 3 is vibrated and starts a dataflow. When value reaches <<<TARGET>>> it again vibrates but this time using a new identity. A vibration simply is the combination of <<<data>>> and <<<event>>>. A vibration simply marks the availability of data.

We can keep adding operators in our dataflow pipeline. Let's add a logger operator so we can see the value in terminal,

```
3 $TARGET ?
$guess
```

By running our app,
"""
sim -f guessing-game.art
"""
3
!!!!

Cool! Let's now add a basic condition and test it. 

```
3 $TARGET ?
$guess

guess = TARGET  "Congratulations! You successfully guess the number!" ?
```
Simorg doesn't have any reserved keywords! So no more <<<if>>>, <<<else>>>, <<<while>>>, etc..!

Line 4 is again a dataflow pipeline which starts by the variable <<<guess>>>. if the value is equal to <<<TARGET>>> then it passes the vibration forward. In this case the incoming vibration will trigger our string value literal and cause it to vibrate. The incoming value is not used anymore. It will cause this value literal to pass it's value to logger operator.



Let's give the same value to <<<guess>>> and test our application,
```
3 $TARGET ?
3 $guess

guess = TARGET  "Congratulations! You successfully guess the number!" ?
```

By running our app,
"""
sim -f guessing-game.art
"""
Congratulations! You successfully guess the number!
!!!!


Let's add more conditions to cover other cases,
```
3 $TARGET ?
3 $guess

guess = TARGET  "Congratulations! You successfully guess the number!" ?
guess > TARGET  "Target is smaller than your guess" ?
guess < TARGET  "Target is bigger than your guess" ?
```

Now we have the core functionality of our app. Let's complete it by importing two blueprints. Simorg like any modern programming language has its own package manager called 
$$$ToPageLinker keyword=Logos toRoute=https://logos.simorg.art$$$.

Let's use a random number generator. Using <<<#>>> before an identifier will help us instantiate our blueprint and have an identifier to call it,
```
"@stl/random0.1.7" #random

9 random.integer $TARGET ?
3 $guess

guess = TARGET  "Congratulations! You successfully guess the number!" ?
guess > TARGET  "Target is smaller than your guess" ?
guess < TARGET  "Target is bigger than your guess" ?
```

By pushing <<<9>>> into <<<random.integer>>>, we will create a random number between <<<0>>> and <<<9>>>, inclusive. Then this value will be set as our target.

Next blueprint is <<<terminal-input>>>. It will help us read a value from terminal,

```
"@stl/random0.1.7" #random
"@stl/terminal-input0.1.6" #terminal

9 random.integer $TARGET ?
"Enter Your Guess: " terminal.promptAndReadLine $guess

guess = TARGET  "Congratulations! You successfully guess the number!" ?
guess > TARGET  "Target is smaller than your guess" ?
guess < TARGET  "Target is bigger than your guess" ?

```

Our application is almost complete. Line 5 will prompt and read a value from terminal. This will then vibrate guess. 

As you noticed Simorg doesn't use any type definitions. Engine tries to convert types automatically. In case of failure a log message will be logged by engine. Simorg doesn't throw any exception at runtime. If something fails, the expected vibration will not happen.

Finally, let's re-arrange a few things to fulfill the requirement of our application and keep asking the user when the guess is not right, 

```
"@stl/random0.1.7" #random
"@stl/terminal-input0.1.6" #terminal

:terminal.promptAndReadLine $guess 

9 random.integer $TARGET "Enter your guess: " guess

guess = TARGET "Congratulations! You guessed right!" ?
guess > TARGET "Target is smaller, Guess again: " guess
guess < TARGET "Target is bigger, Guess again: " guess
```

Line 4, is using an open pipe and helps us re-vibrate this pipeline when we need to receive a new guess.
We use the natural logger capability of <<<promptAndReadLine>>> to ask user for new inputs.

On lines 9 and 10, when user needs to guess again, the vibration is re-directed back into <<<guess>>>. The act of prompting and asking user to enter a number is now part of the declation of <<<guess>>> so whenever something is pushed into <<<guess>>> have to pass through all these pre-processors.

Awesome! Now you have a basic understanding about core aspects of Simorg. The vibration-driven (data- and event-driven) nature of the language is helping us create a new declarative form of solutions.
Also, every single token that we use is referring to an equivalent data entity, in other words we are writing code from data's point of view not from a third-party observer's point of view. This is contributing to the simplicity of the language as we don't need extra unnecessary tokens. This is how Simorg achieves a solution using zero reserved keywords.


To gain a deeper knowledge about simorg, please continue reading our reference book. Happy Coding!

