Showing posts with label gaming. Show all posts
Showing posts with label gaming. Show all posts

Sunday, May 1, 2022

TI-84 Plus CE: All In Chance Game

TI-84 Plus CE:  All In Chance Game


The All In Chance Game


The objective is to get a high score by stopping the 2 x 2 board like this:


A   B

C  D


You score the sum of all four values.   Watch for negative values and zeroes.


Spots B, C, and D range from -2 to 5, while A has four possible values: -5, 0, 5, 10.


How many spins you get?  The game has a spinner from 2 to 7 spins.  


Free spins can be earned.  One way is to stop the board when A = 10.   There are two other ways, can you discover them?  



TI-84 Plus CE Program: ALLIN

(605 bytes)


Full

ClrHome

Output(1,1,"ALL IN GAME")

Output(2,1,"EWS 2022")

Wait 0.5

Output(4,1,"HOW MANY")

Output(5,1,"SPINS?")

Wait 0.5


0

Repeat Ans

randInt(2,7)→S

ClrHome

Output(1,3,"PRESS ANY KEY")

Output(3,3,"SPINS:")

Output(3,11,S)

Wait 0.25

getKey

End


ClrHome

Output(4,3,"YOU GOT")

Output(5,3,S)

Output(5,5,"SPINS!")

Output(7,3,"GOOD LUCK!")

Wait 0.8


0→T

0→M

While S>0

0

Repeat Ans

augment(5*randInt(­1,2,1),randInt(­2,5,3))→L6

ClrHome

Output(1,1,"SPINS LEFT: "+toString(S))

Output(3,4,L6(1))

Output(3,8,L6(2))

Output(6,4,L6(3))

Output(6,8,L6(4))

Output(8,1,"PRESS ANY KEY")

Wait 0.2

getKey

End

sum(L6)→P

T+P→T

If P>M:P→M

If L6(1)=L6(4) or L6(1)=10

Then

Output(1,1,"****FREE SPIN!****")

S+1→S

End

Output(8,1,"YOU GOT "+toString(P)+"         ")

Output(9,1,"TOTAL: "+toString(T))

Output(10,1,"PRESS ENTER")

Pause 

S-1→S

End


ClrHome

Disp "FINAL SCORE: "+toString(T)

Disp "BEST SPIN: "+toString(M)


Notes:


On the line Output(8,1,"YOU GOT "+toString(P)+"         "), extra spaces are needed to "erase" the PRESS ANY KEY message.


0 is entered before the Repeat Ans loop to make Ans "false", allowing for the loop to happen and the player to press any key to exit the loop. See the TI-Basic Developer's page for more details:  http://tibasicdev.wikidot.com/getkey


Source:


"The getKey Command"  TI-BASIC DEVELOPER: The TI-BASIC INFORMATION REPOSITORY.  Retrieved February 6, 2022.  http://tibasicdev.wikidot.com/getkey


This program is made with OS 5.7, but it should work on O.S versions 5.5 and 5.6.  Earlier OS versions may not have the Wait and toString commands.  


L6 refers to List 6, [ 2nd ]  [ 6  ].


Download the file here: 

https://drive.google.com/file/d/1QkrXnt6dR1KgEy-2d9JQxE7jmQS93Drk/view?usp=sharing

HP 32S and HP 32SII Week:  May 2, 2022 - May 6, 2022


Good luck!


Eddie



All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, March 14, 2021

Retro Review: Radio Shack EC-21 (Blackjack Calculator)

Retro Review: Radio Shack EC-21 (Blackjack Calculator) 







Welcome to my birthday blog.  44 years today (March 14, 1977).  

Quick Facts:

Models:  EC-21
Company:  Radio Shack
First Manufactured: 1978
Memory Register:  1 independent memory
Battery:  3 AAA

The Calculator and The Game

The Radio Shack EC-21 is a dual-purpose calculator:  a 10-digit calculator and full blackjack game.

The Calculator

The calculator is a 10 digit, four function calculator with something extra:  a parenthesis [ ( ) ] key.   The parenthesis key allows the user to put certain calculations in higher priority.   The calculator operates in chain mode, the order of operations is not taken into consideration.

Example:  

2 x (3 + 9) = 24

Keystrokes:  2 [ x ] [ ( ) ] 3 [ + ] 9 [ ( ) ] [ = ]

The calculator has a square root function, but it does not have a memory register.

The Game:  Blackjack

In GAME mode, the EC-21 is a one player blackjack game.  It is you against the house.  The house stands on 17 - 21.   

Enter a bet and press the [ √ ] (BET) key.   You are not limited in bankroll.  Once you place the bet, the screen shows all zeroes as the calculator shuffles a deck of 52 playing cards.  Kings, queens, jacks, and tens are shown on the display as an F (face card).  Aces, shown by an A, count as either 1 or 11.  The ace is counted to the player's best benefit.  

If you get a blackjack (Ace and a Face card) you automatically win, the payout is 3:2.  

The game keys are:

[ = ] (HIT): Hit: The player takes a hit.  Be careful, going over 21 will cause you to bust and lose the game.

[ - ] (INS):  Insurance:  If the Dealer's up card is an Ace, you can take insurance, which is half of your bet.  If you take Insurance and the Dealer has a blackjack (Ace and a Face card), you lose only half your bet.

[ + ] (STD):  Stand.   Press this key when you decide to take no more cards.

[ ÷ ] (SPL):  Split.  If you are dealt a pair, you can split your cards into two hands.  If you split aces, you only get one more card per ace.   In this case, any 21 pays off at 1:1.  

[ × ] (DBL):  Double Down.  If you have strong starting hand, such as a 10 or 11 against a Dealer's favorable up card, you can double your bet for one more card.  

After each hand, press the total key ( [ ( ) ] (TOL) ) to check your earnings.  

Keyboard

The keyboard has a solid feel.  However, the keys require a firm press to register.  I have the best luck of holding the calculator in my hand.  In my experience, laying the keyboard down flat did not allow me to register all the keys, particular the zero key.  If wish the keys were not hard to press.  It may be the luck of the draw when I made the purchase. 

I love the colors:  green for the number keys, red of the clear keys, blue for the function keys.  

Verdict

The calculator is stored in a beautiful leather case, and the green display is awesome.  I also like the two-in-one calculator/game.  I wish the keyboard is better, but buying it is not expensive, and I am happy to have this in my collection.  

Source:

Flow Simulation, Ltd.  "Radio Shack EC-21 (Blackjack 21)"  Retrieved January 22, 2021.  https://americanhistory.si.edu/collections/search/object/nmah_334462 

National Museum of American History Behring Center.  "Radio Shack EC-21 Handheld Electronic Calculator, Blackjack"  Washington D.C. Retrieved January 23, 2021.  https://americanhistory.si.edu/collections/search/object/nmah_334462

Eddie

All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Saturday, June 16, 2018

Casio fx-CG 50 and HP Prime: The Price is Right Wheel Simulation


Casio fx-CG 50 and HP Prime: The Price is Right Wheel Simulation

Introduction

On the very famous game show, The Price Is Right, currently enjoying its fifth decade in its current run on television (1972-present), the hour long game show is divided into three segments.  The first two segments are played this way:

* An item up for bid is presented to four contestants who directly called from the audience.  Whoever gets closest to the actual retail price without going over wins the prize and plays a pricing game. This cycle occurs three times.

* The three winners play in a Showcase Showdown, where they spin a wheel.  The goal is obtain a score closest to one dollar without going over.  The winner advances to the final Showcase round.

The third segment is the Showcase round played by the two winners of the Showcase Showdown, where prize packages worth thousands of dollars are at stake.

This blog will present a simulation of the Showcase Showdown.  Like the game show, the amounts are shown in cents, where 100 represents one dollar. 

Single Spin Simulation:  Casio fx-CG 50

This program simulates a single spin.  The spin starts on the dollar (100) space.  The space that the pointer is in red with arrows pointed at it.  You can use the program on monochrome screens if you wish, just not type the color commands (Black, Red).

Casio fx-CG50 Program TRIPWHL1

“EWS 2018-06-12”
{100,15,80,35,60,20,40,
75,55,95,50,85,30,65,10,
45,70,25,90,5}→List 1
1 → P
For 1 → K To RanInt#(20, 60)
ClrText
MOD(P, 20) → P
MOD(P+18, 20) → A
MOD(P+19, 20) → B
MOD(P, 20) → C
MOD(P+1, 20) → D
MOD(P+2 ,20) → E
A = 0 20 → A
B = 0 20 → B
C = 0 20 → C
D = 0 20 → D
E = 0 20 → E
Black Locate 5, 2, List 1[E]
Black Locate 5, 3, List 1[D]
Red Locate 5, 4, List 1[C]
Red Locate 10, 4 “
Black Locate 5, 5, List 1[B]
Black Locate 5, 6, List 1[A]
MOD(P+1, 20) → P
.1 + .4 K → T
For .1 → I To T Step .1
Next
Next

Note:  The lines .1+.4K and the second For loop that follows it is to simulate the wheel that slows down as it spins. 

Now, if you want a complete simulation, check out the HP Prime program TPIRWHEEL.

A Showcase Showdown Round Simulation:  HP Prime Program TPIRWHEEL

The program offers two modes:

2 Player Spinoff:  This is a one spin playoff between two players. 

3 Player Normal:  This is a normal game between three players.  Each player may have up to two spins.  If the score exceeds 1 dollar, the player is out, and given a final score of 0.

When entering the names, you do not need to worry about entering the quotes.

Bonus Spins

Should a player get 1 dollar in one spin or their score from two spins add up to 1 dollar, then the player gets a bonus spin and wins $1,000.  The bonus spin always starts from the 5 cent position.  Unlike the game show, all bonus spins are taken immediately.  Landing on the green 5 cents and 15 cents spaces wins $10,000, while landing on the red dollar space on the bonus spins wins $25,000.  The amount on the bonus spin does not affect the player’s final score.

End of the Game

The end of the game will lists the players and their final scores.

HP Prime Program TPIRWHEEL
The program is over 10,000 bytes in memory. 

sbr1(); // subroutine - wheel

EXPORT TPIRWHEEL()
BEGIN
// EWS 2018-06-09
// The Price Is Right Showcase Showdown
// Simulator - Official Version
// bonus spins starts immediately
// 2 player spinoff mode (manual)

// Setup
LOCAL n,k,j,t,str1,str2,str3;
LOCAL str4,m,b;
CHOOSE(n,"Number of Players",
{"2 Player Spinoff",
"3 Player Normal"});
n:=n+1;
LOCAL players:={};
LOCAL scores:=MAKELIST(0,X,1,n);
LOCAL bonuses:=MAKELIST(0,X,1,n);

// Names
FOR k FROM 1 TO n DO
str1:="Player "+STRING(k);
INPUT({{str2,[[2]]}},str1,"Name: ");
players:=CONCAT(players,{str2});
END;

// Spin the wheel
RECT(RGB(255,255,0));
IF n==3 THEN
TEXTOUT_P("The goal is to get close to",
10,10,7);
TEXTOUT_P("$1.00 without going over.",
10,40,7);
TEXTOUT_P("You can have up to two spins.",
10,70,7);
TEXTOUT_P("Good luck!",10,100,7);
ELSE
TEXTOUT_P("This is a spinoff.",10,10,7);
TEXTOUT_P("Highest number wins.",10,40,7);
END;
TEXTOUT_P("Press any key to
continue.",10,130,7);
WAIT(0);

// spinning the wheel
LOCAL t,w,w1,w2,ch; // pointer
t:=1;

FOR k FROM 1 TO n DO

MSGBOX(players(k)+"'s 1st spin");
m:=MAX(scores);

// Inital spin
w:=sbr1(t);
t:=w(1);
scores(k):=w(2);


// test for $1 and bonus spin
IF scores(k)==100 THEN
RECT();
TEXTOUT_P(players(k)+" has $1.00!",
10,10,7);
TEXTOUT_P("$1,000 bonus!",10,40,7,
RGB(0,128,0));
bonuses(k):=1000;
WAIT(0);
// bonus spin
MSGBOX("Bonus Spin");
w:=sbr1(1);
t:=w(1); b:=0;
IF w(2)==5 OR w(2)==15 THEN b:=10000 END;
IF w(2)==100 THEN b:=25000 END;
IF b>0 THEN
str4:=players(k)+" has won $"+
STRING(b)+"!";
bonuses(k):=bonuses(k)+b;
ELSE
str4:="No bonus money.";
END;
TEXTOUT_P(str4,10,180,7);
WAIT(0);
CONTINUE; END;

IF n==3 THEN
// second spin?
str4:=players(k)+" has "+
scores(k)+" cents.";
TEXTOUT_P(str4,10,180,7);
WAIT(0);

CHOOSE(ch,
"Score to beat: "+STRING(m)+
" Spin Again?",{"SPIN","STAY"});
IF ch==1 THEN

MSGBOX(players(k)+"'s 2nd spin");

w:=sbr1(t);
t:=w(1);
scores(k):=w(2)+scores(k);

// did the player go over?
IF scores(k)>100 THEN
str4:=players(k)+" has gone over.";
TEXTOUT_P(str4,10,200,7,RGB(255,0,0));
WAIT(0);
scores(k):=0;
END;

// test for $1.00 and bonus spin
IF scores(k)==100 THEN
RECT();
TEXTOUT_P(players(k)+" has $1.00!",
10,10,7);
TEXTOUT_P("$1,000 bonus!",10,40,7,
RGB(0,128,0));
bonuses(k):=1000;
// bonus spin
MSGBOX("Bonus Spin");
w:=sbr1(1);
t:=w(1); b:=0;
IF w(2)==5 OR w(2)==15 THEN b:=10000 END;
IF w(2)==100 THEN b:=25000 END;
IF b>0 THEN
str4:=players(k)+" has won $"+
STRING(b)+"!";
bonuses(k):=bonuses(k)+b;
ELSE
str4:="No bonus money.";
END;
TEXTOUT_P(str4,10,180,7);
WAIT(0);
CONTINUE;
END;

END;

END;

// total score
str4:=players(k)+" has "+
scores(k)+" cents.";
TEXTOUT_P(str4,10,180,7);
WAIT(0);

END;


// end of the game
RECT();
TEXTOUT_P("Final Scores",10,10,7);
FOR k FROM 1 TO n DO
TEXTOUT_P(players(k)+":",10,
10+25*k,7);
TEXTOUT_P(STRING(scores(k)/100,2,2),170,
10+25*k,7);
IF bonuses(k)>0 THEN
TEXTOUT_P("$"+STRING(bonuses(k),2,0),
225,10+25*k,7,RGB(0,128,0)); END;
END;
WAIT(0);

END;


// subroutine spin the wheel
sbr1(x)
BEGIN
LOCAL wheel;

// colors
LOCAL b:=RGB(255,240,240); // snow white
LOCAL r:=RGB(255,0,0); // red
LOCAL dg:=RGB(0,255,0); // lime green
LOCAL tn:=RGB(255,208,0); // tangerine

// the wheel {{amount, color}}
wheel:=
{{100,r},{15,dg},{80,b},
{35,b},{60,b},{20,b},{40,b},
{75,b},{55,b},{95,b},{50,b},
{85,b},{30,b},{65,b},{10,b},
{45,b},{70,b},{25,b},{90,b},
{5,dg}};

// pointer
LOCAL pt,k,pm2,pm1,pc,pp1,pp2;
pt:=x;


// wheel display
FOR k FROM 1 TO RANDINT(20,60) DO
RECT();
pt:=pt MOD 20;

// display
pm2:=(pt+18) MOD 20;
pm1:=(pt+19) MOD 20;
pc:=pt MOD 20;
pp1:=(pt+1) MOD 20;
pp2:=(pt+2) MOD 20;


// box the numbers
RECT_P(74,44,164,144,0);
// borders
LINE_P(74,44,164,44,tn);
LINE_P(74,64,164,64,tn);
LINE_P(74,84,164,84,tn);
LINE_P(74,104,164,104,tn);
LINE_P(74,124,164,124,tn);
LINE_P(74,144,164,144,tn);
LINE_P(74,44,74,144,tn);
LINE_P(164,44,164,144,tn);
// side decoration - left with $
FILLPOLY_P([(28,44),(43,24),(58,24),
(73,44),(73,144),(28,144)],
RGB(255,128,0));
TEXTOUT_P("$",44,74,7,RGB(224,224,224));
// side decoration - right
FILLPOLY_P([(165,44),(180,24),(195,24),
(210,44),(210,144),(165,144)],
RGB(255,128,0));
// draw the pointer
TEXTOUT_P("<<",165,80,7,RGB(255,0,0));
// draw the numbers
TEXTOUT_P(wheel(pp2,1),95,40,7,
wheel(pp2,2));
TEXTOUT_P(wheel(pp1,1),95,60,7,
wheel(pp1,2));
TEXTOUT_P(wheel(pc,1),95,80,7,
wheel(pc,2));
TEXTOUT_P(wheel(pm1,1),95,100,7,
wheel(pm1,2));
TEXTOUT_P(wheel(pm2,1),95,120,7,
wheel(pm2,2));

// slow down the wheel
WAIT(0.08+0.01*k);
// next pointer
pt:=pt+1 MOD 20;

END;

// store results
LOCAL x1:=(pt-1) MOD 20;
IF x1==0 THEN x1:=20; END;
LOCAL x2:=wheel(x1,1);
RETURN {x1,x2};

END;

Source:

“Showcase Showdown” The Price Is Right Wiki.  Retrieved June 8, 2018.  http://priceisright.wikia.com/wiki/Showcase_Showdown

Eddie

All original content copyright, © 2011-2018.  Edward Shore.  

Saturday, June 9, 2018

HP Prime: The Money Machine Game


HP Prime: The Money Machine Game



The month of games continue…

This is a simple game where the machine randomizes between $250 to $50,000.  Press [ Enter ] whenever you feel lucky.  Good luck!

HP Prime Program GAME_MONEY

EXPORT GAME_MONEY()
BEGIN
// Money Machine random game
// 2018-03-26 EWS

// Localize variables
LOCAL K,c,d,s,lst,t1,t2,t3;

// Dark green screen (fir green)
RECT(#003000h);

// Intro screen
K:=GETKEY;
WHILE K≠30 DO
TEXTOUT_P("Are you ready to make money?",
0,0,4,#FFFF00h);
TEXTOUT_P("Then step right up, to the",
0,20,4,#FFFF00h);
TEXTOUT_P("Money Machine! Press ENTER",
0,40,4,#FFFF00h);
TEXTOUT_P("when you feel lucky! GOOD LUCK!",
0,60,4,#FFFF00h);
TEXTOUT_P("Press ENTER to continue.",
0,120,4,#00FFFFh);

K:=GETKEY;
END;

// The game
lst:={250,250,250,500,500,500,
1000,1000,1000,2000,2000,2000,2500,
2500,5000,5000,10000,15000,25000};
S:=SIZE(lst);

K:=GETKEY;
WHILE K≠30 DO
RECT(0);

// decorate
t1:=RANDINT(0,310);
t2:=RANDINT(0,310);
t3:=RANDINT(0,310);
// star is character 9733
TEXTOUT_P(CHAR(9733),t1,0,4,#FFFFFFh);
TEXTOUT_P(CHAR(9733),t2,0,4,#FFFFFFh);
TEXTOUT_P(CHAR(9733),t3,0,4,#FFFFFFh);
TEXTOUT_P(CHAR(9733),t1,200,4,#FFFFFFh);
TEXTOUT_P(CHAR(9733),t2,200,4,#FFFFFFh);
TEXTOUT_P(CHAR(9733),t3,200,4,#FFFFFFh);

// generate dollar amount
c:=RANDINT(1,S);
d:=lst[c];
// 7 is the largest font
TEXTOUT_P("$"+STRING(d),100,60,7,#00FF00h);
// wait one quarter second
WAIT(1/4);
K:=GETKEY;
END;

// Results screen
RECT(#003000h);
TEXTOUT_P("$"+STRING(d),100,60,6,#00FFFFh);
TEXTOUT_P("You won $"+STRING(d)+"!",
0,180,4,#FFFFFFh);
WAIT(0);

END;

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

HP 32SII and HP Prime: Throwing Dice


HP 32SII and HP Prime: Throwing Dice

Note: Symbols that are produced by Unicode should, but may not show up on all browsers. Please make sure your browsers are updated to the latest version.  
⚀ ⚁ ⚂ ⚃ ⚄ ⚅

Let Em’ Roll

One way to simulate a pair of dice being thrown is to generate two random integers between 1 through 6.  The integers are either shown as a pair or vector of integers.  For calculators that do not have a list capacity or want a more compact representation, the program for the HP 32S II (which can easily apply almost to any other programming calculator), in the format A.0B, where A is one die and B is the other.   For example, 3.06 represents a 3 and a 6 being thrown.

The formula would be:   RandInt(1,6) + RandInt(1,6)/100

On certain Sharp calculators, such as the Sharp EL-W516T, the R.DICE function generates a single digit between 1 and 6.

HP 32 SII Program: Dice Generator

D01 LBL D
D02 RANDOM
D03 6
D04 *
D05 1
D06 +
D07 IP
D08 1
D09 %
D10 RANDOM
D11 6
D12 *
D13 1
D14 +
D15 IP
D16 +
D17 RTN

HP Prime:  Graphical Representation of Dice

We can also use the Unicode representation of dice.

Unicode Character
Decimal
Hexadecimal
9856
2680
9857
2681
9858
2682
9859
2683
9860
2684
9861
2685

Unicode characters need to be in strings.  The HP Prime program RDICE returns a list, the roll in compact format, along with the Unicode representation.  This is only one of many ways to do it.

An example output of RDICE is {4.02, “”, “”}

HP Prime Program: RDICE

EXPORT RDICE()
BEGIN
// rolling dice A.0B
LOCAL A, B, C, D;
ARANDINT(1,6); C9855+A;
BRANDINT(1,6); D9855+B;
RETURN {A+B/100, CHAR(C), CHAR(D)};
END;

Have fun and roll those dice,

Eddie


All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Sunday, June 3, 2018

Sharp EL-5500 III: Slots: Triples and Cherries Pay


Sharp EL-5500 III:  Slots:  Triples and Cherries Pay

BAR | BAR | BAR
   7    |   7    |   7
   🍒  |   🍒   |  🍒

Note: Symbols that are produced by Unicode should, but may not show up on all browsers. Please make sure your browsers are updated to the latest version.  

Take a Spin

This program is a three reel slot simulator, each with ten symbols:

0:  BAR
1:  Cherry (🍒)
2:  Orange
3:  Plum
4:  Bell (🔔)
5:  Lemon (🍋)
6:  Watermelon (🍉)
7:  Seven
8:  Apple (🍎)
9:  Shamrock ()

To see the version for the HP 32SII, please click here:  https://edspi31415.blogspot.com/2018/06/hp-32s-ii-two-versions-of-slots.html

🍒 | 🍒 | 🍒

Each spin has an ante of 25¢.  The results appear in the form 0.###  (ignore the left most 0.)  See the Take a Spin section above for the symbols used in the game.

The payouts are these:

A cherry in any one slot (0.1xy, 0.x1y, or 0.xy1):  $1.00
Any two cherries (0.11x, 0.1x1, 0.x11):  $10.00
Three BARS (0.000):  $35.00  ($15 + $20)
Three Sevens (0.777):  $70.00  ($50 + $20)
Any other triple (0.xxx, x0 and x7):  $20.00

Note: You can use any line numbering system, I used the line numbers 1400-1499 for this program. The first “D” on line 1400 is optional, but is there to make the program a defined program for the EL-5500 III, running it by pressing [DEF] [ D ].  If you are using another calculator, this may not be an option, so ignore the “D” in that case.

Sharp EL-5500 III Program Slots: Triples and Cherries Pay

1400: “D”: PAUSE “Slots”   
1402: CLEAR
1404: INPUT “Bankroll: $”; J
1406: P = 0
1408: J = J - .25
1410: N = .1*(RND 10-1)+.01*(RND 10-1)+.001*(RND 10 – 1)
1412: PRINT USING “########”; 1000*N
1414: S = N/.111
1416: IF (S-INT(S)) = 0 THEN 1450
1418: X = N: GOSUB 1430
1420: X = S: GOSUB 1430
1422: X = S: GOSUB 1430
1424: J = J + INT(TEN (P – 1))  // TEN: 10^x
1426: GOTO 1470

1430: I = INT(X*10)
1432: S = 10*X – I
1434: IF I = 1 THEN LET P = P + 1
1436: RETURN

1450: IF S = 0 THEN LET J = J + 35
1452: IF S = 7 THEN LET J = J + 50
1454: IF S<>0 AND S<>7 THEN LET J = J + 20
1456: GOTO 1470

1470: PRINT “Bank $”; USING “##########.##”; J
1472: INPUT “1 = Again ? :”, C
1474: IF C = 1 THEN 1406
1476: END

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in c...