I was so pleased to receive Gatordogs PM
about the new IDE with UPX . . .
. . . that I wrote the enclosed from scratch in Geany
(the enclosed zip file does not include a compiled version)
Here is the code for the fish to laugh at
Code: Select all
#!/usr/bin/bacon -b
' Command line Buddhist YinYana Mala
' Test Compiled on Puppy Linux 5.3 Slacko
' Nov 2011 Created by Lobster
'''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''
' Set Initial State
'''''''''''''''''''''''''''''''''''
COLOR RESET
CLEAR
SUB How_many
'''''''''''''''''''''''''''''''''''
' How many repetitions
'''''''''''''''''''''''''''''''''''
PRINT
COLOR FG TO WHITE
COLOR BG TO BLUE
CLEAR
PRINT
PRINT " -= How many repetitions would you like? =-"
PRINT
PRINT " Type in a number and press ENTER"
PRINT
PRINT " -= Press 0 and ENTER for Auto mode =-"
COLOR FG TO RED
INPUT repeats
CLEAR
END SUB
SUB InitialMenu
'''''''''''''''''''''''''''''''''''
' Select Style options
'''''''''''''''''''''''''''''''''''
COLOR FG TO BLUE
COLOR BG TO WHITE
CLEAR
COLOR FG TO WHITE
COLOR BG TO BLUE
PRINT "----------------------------------------"
PRINT " YinYana Mantra Practices "
PRINT "----------------------------------------"
COLOR FG TO BLUE
COLOR BG TO WHITE
PRINT
PRINT " Press 1 and ENTER for MANI's beginners"
PRINT " Press 2 and ENTER for GANESH mantra"
PRINT " Press 3 and ENTER for MEDICINE BUDDHA"
PRINT " Press 4 and ENTER for YINYANA mantra"
PRINT " Press 5 and ENTER for WRATHFUL Practice"
PRINT " Press 6 and ENTER for AMITABA Practice"
COLOR FG TO RED
INPUT mantra_choice$
'''''''''''''''
' Make choice
'''''''''''''''
IF mantra_choice$ = "1" THEN
COLOR FG TO RED
COLOR BG TO YELLOW
CLEAR
SYSTEM "mplayer omm.wav"
mantra$ = " OM MANI PEME HUM"
CLEAR
ENDIF
IF mantra_choice$ = "2" THEN
COLOR FG TO WHITE
COLOR BG TO GREEN
CLEAR
mantra$ = " OM GANAPATAYA NAMAHA"
SYSTEM "mplayer ganesh.mp3"
CLEAR
ENDIF
IF mantra_choice$ = "3" THEN
COLOR FG TO WHITE
COLOR BG TO BLUE
CLEAR
mantra$ = " OM BEKANZA BENKANZA RA ZA TSA MUN GATE SOHA"
CLEAR
ENDIF
IF mantra_choice$ = "4" THEN
COLOR BG TO WHITE
COLOR FG TO CYAN
CLEAR
mantra$ = " MAY TRE YA, OM TRE YA OM, YA OM MAY YA HUM"
CLEAR
ENDIF
IF mantra_choice$ = "5" THEN
COLOR BG TO WHITE
COLOR FG TO RED
CLEAR
mantra$ = " OM AH HUM VAJRAKILI KILAYA HUM PEY"
CLEAR
ENDIF
IF mantra_choice$ = "6" THEN
COLOR BG TO WHITE
COLOR FG TO RED
CLEAR
mantra$ = " AMITABA"
SYSTEM "mplayer amtb8.wav"
CLEAR
ENDIF
END SUB
SUB QueDisplay
''''''''''''''''''''''''''''''''
' Help Display
''''''''''''''''''''''''''''''''
COLOR FG TO WHITE
COLOR BG TO BLUE
CLEAR
PRINT
PRINT " ----------------------------------------"
PRINT " YinYana Virtual Mala - What it is? "
PRINT " ----------------------------------------"
PRINT
PRINT " For Vajrayana practitioners, common mantras"
PRINT " are repeated in 108 lots"
PRINT " It corresponds to the bead number"
PRINT " on a mala or Buddhist rosary"
PRINT
PRINT " The chanting generates a mind calming effect"
PRINT
PRINT " You will be given a selection of mantras to repeat"
PRINT " and prompted for the number of repetitions"
PRINT
COLOR FG TO BLUE
COLOR BG TO WHITE
PRINT " Ctrl + c to Quit, ENTER to continue"
INPUT return_to_menu$
END SUB
SUB DisplayAffirmations
''''''''''''''''''''''''''''''''
' Display Affirmations in terminal
''''''''''''''''''''''''''''''''
x=0
CURSOR <OFF>
REPEAT
x=x+1
PRINT " ",x," ",mantra$
IF repeats = 0 THEN SLEEP 5000
ELSE INPUT c$
UNTIL x = repeats
END SUB
'''''''''''''''''
' Run Program
'''''''''''''''''
CALL QueDisplay
CALL How_many
CALL InitialMenu
CALL DisplayAffirmations
CALL InitialMenu
''''' END Program
Right at the top you will see
This means you do not have to compile the program to run it
using something called a 'Shebang' (news to me as I have led a sheltered programming life)
You just run the program from the command line like so
--------
The program is command line only
I am running Slacko, so used the SYSTEM command to run mplayer
One thing that got me - Python does this too
You must have a blank line at the end of your program
- the error messages were very good
Been a while since I programmed in BASIC.
This page was helpful
http://www.basic-converter.org/documentation.html
In particular the ability to use
and then
means structured procedural programs are possible
(gosh - almost sound like I know what I am talking about)