From 133df97f8d0aa07546660d3210c1542448c9e787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerem=20=C3=9C?= Date: Sun, 6 Oct 2024 21:13:20 +0300 Subject: [PATCH] add more examples to readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 786cc89..0db31c0 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,27 @@ def arr_of_nums = [1, 2, 3]; def boolean_variable = true; ``` +Define functions and use call expression. + ``` def factorial = func(x) { if (x == 0) { 1 } else { x * factorial(x - 1) } }; factorial(4); ``` +Use index expression. + +``` +def arr = [1, 2, 3]; +arr[0]; +``` + +Use hashmap. + +``` +def mymap = {"name": "Rizzler", "version": 1}; +mymap["name"]; +``` + #### Built-in Functions ##### `puts` and `rizz`