Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CasioBasicWrapper

A collection of python functions for compiling Casio-Basic scripts in python.

Example (read the libraray, it's self explanatory):

assignments

assign("C", 1337)

Loops and conditions

        cb_for(
            "I", 0, "N-1", 1,
            pr_var("I"),
        )
        
        cb_if(
            not_equal("Mat B[J,I]", 0),
            pr_txt("not 0"),
        )

support for Matrices and Lists

        alloc_matrix("C", "M", 1)
        assign("Mat C", mult("Mat B", "Mat A"))

1. Calculating the entropy of given characters given their probability

    casio_basic_code = main(
        pr_txt("Entropy"),

        pr_txt("N?:"),
        rd("N"),
        pr_txt("sub intervals?:"),
        rd("C"),
        cb_if(
            not_equal("C", 0),
            assign("C", logab(2, "C"))
        ),

        # sum
        clear("A"),
        clear("B"),
        cb_for(
            "I", 0, "N-1", 1,
            pr_txt("enter p(i):"),
            rd("A"),
            assign("B", add("B", mult("A", add(logab(2, div(1, "A")), "C"))))
        ),

        pr_var("B"),
    )
    print(casio_basic_code)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages