Mar 24, 11:08 PM

When programming a computer, you refer to values using names called variables, like so:

y = 2. x = y + 3.

Here in the first sentence, you’re saying that y is a variable of value 2.

In the second sentence, you’re saying that x is a variable that is 3 more than y.

The reason we need to use names like x and y is because they make it easier to make a sequence of changes to a value.

Take the following instructions.

x is 2. Increment it by 13. What is the value of x?

We needed to use x in the third sentence to indicate the value that was incremented by 13.

Just remember that that’s what variables do. They name numbers.

Now, here is another useful way to think about variables:

When I was a kid, I used the mental picture of a box in which a number was stored.

The name of the box was the variable’s name. So, you could think of x as the name of a box that stores the value 15 (was 2 before it was incremented by 13).

In Vaklipi, you would write the above command sequence as:

x is 2. Increment x by 13. What is x?

(Vaklipi doesn’t yet support coreferencing – using prepositions like ‘it’ – but will in the near future).

You could also write:

x is equal to 2. What is x?

as shown in the following demo.

program run()
x is equal to 2. What is x? 2.0
x is 7. Increment x by 7. What is x? 14.0

Run test

We can also put text snippents (called strings) into variables in the same way.

program run()
x is 6. What is x? 6.0
Var x is “Mango”. What is x? Mango
Variable x is equal to false. What is x? false

Run test

In Hindi, you would say something like:

पा ३ है. (pa is 3.)


पा का मान ३ है. (pa’s value is 3.)

program variable run()
पा का मान ३ है. पा 3.0

Run test


You can learn programming with Vaklipi in the following pages:

  1. Introduction: Learn about Vaklipi
  2. Output: Learn to write out messages in Vaklipi
  3. Declarations: Learn to set the value of a variable
  4. Operators: Learn to do addition, multiplication, division etc.
  5. Conditionals: Learn to take specify the conditions for performing certain steps.
  6. Looping: Learn to repeat steps till some condition is satisfied.
  7. Jumping: Learn to jump to some point in the code.
  8. Functions: Learn to issue an command.
  9. Constructors: Learn to create an object of a certain type.
  10. Selectors: Learn to refer to a real world object.

Cohan Sujay Carlos




Commenting is closed for this article.