THE BULDA LANGUAGE


At the very very first moment Arendelle was not a fancy language with all it's features like it is today, But I started it as one simple five-command-only toy on my calculator for fun. I was in my grandma and my little cousin and was bored when I was reading something about learning programming to kids. And this idea came to me that I can learn him a bit of programming to entertain him for a while, I found a game from code.org where they explained a code style with 5 command and grid to navigate in it and paint where you are to create graphics and I explained it to my cousin and he was happy so I started to think that the code style is looking so cool and matches many of my thinking styles and well it has a very great power to help people think a bit more computerish! So just to entertain my cousin more I started to create a program for the code but the problem was I only had my calculator with me and I had to create the app for my calculator. As the only input there was numbers I could choose a singe number for each of those 5 command and make a code like 5425425 which every digit represent one command but the question was? How to read one digit at time?

 

MATHEMATICAL NUMBER STRING-ARRAY LIKE INDEX READING EQUATION


In today modern languages we can easily read any index of any string like "hello"[1] = 'e' but there is this problem with numbers that how do we have to read their single digits? Some people use MOD command but in my calculator and Arendelle Language there is no MOD so we have to create our own technique. I created this this equation long before Bulda and then used it for Bulda:

   

   

The formula gives each number from right to left a number starting from 1 like this:

   number = 3 6 9 2 4 5 2 3 7
index = 9 8 7 6 5 4 3 2 1

So for example index(number,4) = 5 , index(number,7) = 9 and so on.

 

HOW TO USE BULDA


We have only 5 commands: 

1:up 2:right 3:left 4:down 5:paint

To use the language you have to first write the code and then enter it upside down... What? let's look at this example:

 

The code for this shape will be: 225244353535 right? but you have to write it's mirror which will be: 535353442522 ( try it out...)

 

ARENDELLE SOFTWARE

// Copyright 2014 Pouya Kary
// Bulda was the first version
// of the language with only 5
// commands for navigating and
// painting that I wrote in my 
// CASIO Prizm (fx-CG10)
// calculator for fun.
      
// Also it's good to know that
// Bulda was the troll who kept
// critoff and sven in Disney's
// full featured animation movie
// Frozen!
   
// title
   'The Bulda Language'

// doing for ever
   ( WhileSign , 1 )
   [ @WhileSign = 1 ,
   
      // asking for the code:
         ( code , "Please enter your Bulda code:")
      
      // calculating the size
         ( size , Floor ( Log10 ( @code ) ) + 1 )
      
      // controling sp
         ( i , 1 )
         ( x , 0 )
         ( y , 0 )
      
      
         //////////////////////////////
         /// MAIN BULDA INTERPRETER ///
         //////////////////////////////
      
      // main while
   
         { @code = 0 , ( size , 1 ) }
   
         [ @size ,
               
            // reading the command
               ( command , 
                   
                   Floor ( @code / Pow ( 10 , @i - 1 ) )
                   - Floor ( @code / Pow ( 10 , @i ) ) * 10
              
               )
      
            // up command
               { @command = 1 ,
                  ( y , -1 )
               , 
               // right commnad
                  { @command = 2 ,
                     ( x , +1 )
                  ,
                  // left commnad
                     { @command = 3 ,
                        ( x , -1 )
                     ,
                     // down command
                        { @command = 4 ,
                           ( y , +1 )
                        ,        
                        // paint command
                           { @command = 5 ,  
                              i [ @x * 2 , r ]
                              [ @y , d ] prp
                           ,
                           // exit command
                              { @command = 6 ,
                                 ( WhileSign , 0 )     
                              }
                           }                   
                        }
                     }
                  }
               }
   
            // going to the next char
               ( i , +1 )
   
         ]
   
      // waiting to see the result
         s
   
   ]
   
// done

NOTE 1 : Theoretically you can write as much as code as you want but unfortunately because of computer error calculating and scientific numbers and Prefixes you can not write more then 9 commands in Arendelle Language version of Bulda

NOTE 2 : Use the number 6 to exit

 

CASIO-BASIC SOFTWARE


The calculator version of Bulda supports up to 14 commands and comes with a funny debugging screen. here look at this screenshot :

     

Download the CASIO-BASIC app for your CASIO fx-CG 10 / 20

NOTE : To install the script you have to move the .g3m file to your calculator using USB cable and put it in @MainMem > PROGRAM