Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Examples: Monday, today, last week, Mar 26, 3/26/04
Welcome home! Please contact lincoln@icrontic.com if you have any difficulty logging in or using the site. New registrations must be manually approved which may take several days. Can't log in? Try clearing your browser's cookies.

Cyber Prayer Wheel

lobsterlobster Veteran
edited March 2017 in Buddhism Today

Need to do extra puja? No prayer wheel to spin?
Let the computer take the strain
The Swift program can be run from a web browser (click on the blue arrow)
The other two languages I also wrote, tested and ran on my Linux computer ...
Oh I feel all virtuous . . . ;)
Needed to do some simple programming to get back into it . . .

Cyber Buddhist Prayer Wheel

Swift

for i in 0..<108 {
    print("OM YA HA HUM HRIH")
    print("OM MANI PEME HUM HRIH")
    print("OM TARE TUTARE TURE SOHA")
}

http://swift.sandbox.bluemix.net/#/repl/58bd60e6d6a2863888a71148

Python

Sum = 1
Mantra1 = " OM YA HA HUM HRIH"
Mantra2 = " OM MANI PEME HUM HRIH"
Mantra3 = " OM TARE TUTARE TURE SOHA"

while Sum < 109 :
    print (Sum) ; print (Mantra1) ; print (Mantra2) ; print (Mantra3)
    Sum+=1

Bashscript

#!/bin/sh
# A simple shell script to print mantra for a set repetitions

count_mantras=0

for i in {1..109}
do
    ((count_mantras++))
    echo $count_mantras "OM YA HA HUM"
    echo $count_mantras "OM MANI PEME HUM HRIH"
    echo $count_mantras "OM TARE TUTARE TURE SOHA"
done    
KundokeranceBunks

Comments

  • lobsterlobster Veteran
    edited March 2017

    Found I had a great mantra program written in Bacon BASIC

    Been working on GROWL ...

    now may be ready to update YAP, been a while ...
    http://puppylinux.org/wikka/BuddhistYAP
    ... gotta find code ...

    Yep I iz a Linux geek :3
    http://www.murga-linux.com/puppy/viewtopic.php?p=309455#309455

    http://archive.is/mkh4i

  • Below is another prayer wheel written as a web page with javascript.
    Can be saved as a text file and loaded into most browsers

    call the text file mantra.html

    It has comments so you can change the repetition number and mantras used . . .

    <!DOCTYPE html>
    <html>
    <body>
    <p id="demo"></p>
    <script>
    // mantra in speech marks added in the below line   
    var mantras = [" OM MANI PEME HUM HRIH", " OM YA HA HUM HRIH", " OM TARE TUTARE TURE SOHA", " OM BEKANZE BEKANZE MAHA BEKANZE RADZA SAMUDGATE SOHA", " NAMO AMITABHA", " "];
    var text = "";
    var i;
    
    // counting begins at 0, so changing 109 in below line will increase number of chants to more than 108 
    for (num_repeats = 0; num_repeats < 109; num_repeats++) 
        {
    for (i = 0; i < mantras.length; i++) { 
        text +=  num_repeats + mantras[i] +  "<br>";
                                                              }
        }
    document.getElementById("demo").innerHTML = text;
    </script>
    </body>
    </html>
    
Sign In or Register to comment.