EasyManua.ls Logo

AMSTRAD CPC464 - Page 101

AMSTRAD CPC464
249 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
690 GOTO 520
700 LOCATE 12,19
710 IF T<S THEN 680
720 PRINT"THE HOUSE WINS"
730 GOTO 520
740 REM DEAL CARD
750 LET CARD=INT ( RND(1)*52+1)
760 IF PACK(CARD)=1 THEN GOTO 750
770 PACK(CARD)=1
780 F=CARD-13*INT(CARD/13)
790 IF F=0 THEN F=13
800 IF F=1 OR OR F>10 THEN GOTO 850
810 PRINT F;" OF ";
820 IF F>10 THEN F=10
830 PRINT SUIT$(INT(CARD-1)/13)+1)
840 RETURN
850 IF F=ll THEN PRINT "JACK OF ";
860 IF F=12 THEN PRINT "QUEEN OF ";
870 IF F=13 THEN PRINT “KING OF “;
880 IF F<>1 THEN GOTO 820
890 F=11
900 PRINT "ACE OF ";
910 GOTO 830
Enter T for a twist (your next card to add to those originally dealt to you), or S to stick and play the
house. We dont claim that this is the last word in card games for your CPC464, but it will provide
you with a substantial bone upon which to add the meat of graphics and sound.
(Note that you must enter T(twist) or S(stick) in upper case capital letters).
4.13 Logical Expressions.
A major difference between a calculator and computer is the computers ability to handle logical
operations in applications like the conditional IF . . . . THEN sequence. To do this, the logical
operators treat the values to which they are applied as bit patterns (bitwise), and operate on the
individual bits. The description and use is entirely, well . . ..er logical - but it is notoriously difficult
to describe logic in simple terms without the precision of the concise definitions.
The two halves of the logical expression are known as the arguments. A logical expression comprises:
<argument>[<logical operator)<argument>]
where:
<argument> is: NOT <argument>
or: <numeric expression>
or: <relational expression>
or: (<logical expression>)
Both the arguments for a logical operator are forced to integer representation, and Error 6 results if
an argument will not fit into the integer range.
The logical operators, in order of precedence, and their effect on each bit are :
AND Result is 0 unless both argument bits are 1
OR Result is 1 unless both argument bits are 0
XOR Result is 1 unless both argument bits are the same
AND is the most commonly employed logical operator, and does not mean add.
PRINT 10 AND 10
Results in the answer 10.

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals