<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://air.imag.fr/index.php?action=history&amp;feed=atom&amp;title=D%C3%A9veloppement_BasicCard%2FGamblingCard%2FISSUER.BAS</id>
	<title>Développement BasicCard/GamblingCard/ISSUER.BAS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://air.imag.fr/index.php?action=history&amp;feed=atom&amp;title=D%C3%A9veloppement_BasicCard%2FGamblingCard%2FISSUER.BAS"/>
	<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=D%C3%A9veloppement_BasicCard/GamblingCard/ISSUER.BAS&amp;action=history"/>
	<updated>2026-06-22T03:25:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://air.imag.fr/index.php?title=D%C3%A9veloppement_BasicCard/GamblingCard/ISSUER.BAS&amp;diff=19753&amp;oldid=prev</id>
		<title>Donsez: Created page with &quot;  &lt;source lang=&quot;blitzbasic&quot;&gt; Rem Gambling BasicCard Source Code Rem ------------------------------------------------------------------ Rem Copyright (C) 2002 Didier DONSEZ Rem...&quot;</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=D%C3%A9veloppement_BasicCard/GamblingCard/ISSUER.BAS&amp;diff=19753&amp;oldid=prev"/>
		<updated>2014-12-03T13:59:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  &amp;lt;source lang=&amp;quot;blitzbasic&amp;quot;&amp;gt; Rem Gambling BasicCard Source Code Rem ------------------------------------------------------------------ Rem Copyright (C) 2002 Didier DONSEZ Rem...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;blitzbasic&amp;quot;&amp;gt;&lt;br /&gt;
Rem Gambling BasicCard Source Code&lt;br /&gt;
Rem ------------------------------------------------------------------&lt;br /&gt;
Rem Copyright (C) 2002 Didier DONSEZ&lt;br /&gt;
Rem ------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Rem  GAMBLING CARD&lt;br /&gt;
&lt;br /&gt;
Rem  Personalisation program for the Gambling Card&lt;br /&gt;
Rem&lt;br /&gt;
Rem  Prompts the user for name, PIN, and balance, and personalises a Gambling Card&lt;br /&gt;
&lt;br /&gt;
Option Explicit&lt;br /&gt;
Option Base Explicit&lt;br /&gt;
&lt;br /&gt;
#Include GAMBLING.DEF  &amp;#039; Declarations common to BasicCard and Terminal programs&lt;br /&gt;
rem #Include DEALER.KEY&lt;br /&gt;
rem #Include ISSUER.KEY&lt;br /&gt;
&lt;br /&gt;
#Include CARDUTIL.DEF&lt;br /&gt;
#Include COMMERR.DEF&lt;br /&gt;
#Include COLOURS.DEF&lt;br /&gt;
&lt;br /&gt;
Call WaitForCard()&lt;br /&gt;
ResetCard : Call CheckSW1SW2()&lt;br /&gt;
&lt;br /&gt;
Rem  Check that the application name is correct&lt;br /&gt;
Private Name$ : Call GetApplicationID (Name$) : Call CheckSW1SW2()&lt;br /&gt;
If Name$ &amp;lt;&amp;gt; ApplicationName$ Then Print &amp;quot;This is not a Gambling Card !&amp;quot; : Exit&lt;br /&gt;
&lt;br /&gt;
Rem  Get the customer name&lt;br /&gt;
&lt;br /&gt;
Private PIN$, Balance$, Amount&amp;amp;, Len@&lt;br /&gt;
Private SRatio$, Ratio&amp;amp;&lt;br /&gt;
&lt;br /&gt;
FgCol = Cyan : Print &amp;quot;Customer name (Enter to abort): &amp;quot;;&lt;br /&gt;
FgCol = BrightYellow : Line Input Name$&lt;br /&gt;
If Name$ = &amp;quot;&amp;quot; Then Exit&lt;br /&gt;
&lt;br /&gt;
Rem  Get the PIN&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
    FgCol = Cyan : Print &amp;quot;PIN (Enter to abort): &amp;quot;;&lt;br /&gt;
    FgCol = BrightYellow : Line Input PIN$&lt;br /&gt;
    If PIN$ = &amp;quot;&amp;quot; Then Exit&lt;br /&gt;
    If Len (PIN$) = 4 Then Exit Do&lt;br /&gt;
    FgCol = Red : Print &amp;quot;PIN must be 4 characters long&amp;quot;&lt;br /&gt;
Loop&lt;br /&gt;
&lt;br /&gt;
Rem  Get the initial balance&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
    FgCol = Cyan : Print &amp;quot;Initial balance (e.g. 12.50): &amp;quot;;&lt;br /&gt;
    FgCol = BrightYellow : Line Input Balance$&lt;br /&gt;
    FgCol = BrightWhite&lt;br /&gt;
    Balance$ = Trim$ (Balance$)&lt;br /&gt;
    If Balance$ = &amp;quot;&amp;quot; Then Print &amp;quot;Personalization aborted&amp;quot; : Exit&lt;br /&gt;
&lt;br /&gt;
    Rem  Convert Balance$ to Long via a Single value (in marks)&lt;br /&gt;
    Amount&amp;amp; = (100 * Val! (Balance$, Len@)) + 0.5&lt;br /&gt;
    If Len@ = Len (Balance$) Then Exit Do &amp;#039; Exit if all characters were used&lt;br /&gt;
    Print &amp;quot;Invalid number&amp;quot;&lt;br /&gt;
Loop&lt;br /&gt;
&lt;br /&gt;
Do&lt;br /&gt;
    FgCol = Cyan : Print &amp;quot;Winning ratio (e.g. 0.75): &amp;quot;;&lt;br /&gt;
    FgCol = BrightYellow : Line Input SRatio$&lt;br /&gt;
    FgCol = BrightWhite&lt;br /&gt;
    SRatio$ = Trim$ (SRatio$)&lt;br /&gt;
    If SRatio$ = &amp;quot;&amp;quot; Then Print &amp;quot;Personalization aborted&amp;quot; : Exit&lt;br /&gt;
&lt;br /&gt;
    Rem  Convert SRatio$ to Long via a Single value (in marks)&lt;br /&gt;
    Ratio&amp;amp; = (100 * Val! (SRatio$, Len@)) + 0.5&lt;br /&gt;
    If Len@ = Len (SRatio$) Then Exit Do &amp;#039; Exit if all characters were used&lt;br /&gt;
    Print &amp;quot;Invalid number&amp;quot;&lt;br /&gt;
Loop&lt;br /&gt;
&lt;br /&gt;
Rem  Send the data to the card. The card only accepts issuer data that is&lt;br /&gt;
Rem  encrypted with the Issuing Key (Key 00):&lt;br /&gt;
&lt;br /&gt;
Rem  Try automatic algorithm selection first:&lt;br /&gt;
Rem Call StartEncryption (P1=0, P2=0, Rnd)&lt;br /&gt;
Rem If SW1SW2 = swUnknownAlgorithm Then&lt;br /&gt;
  Rem  That didn&amp;#039;t work, so it must be a Compact BasicCard:&lt;br /&gt;
  Rem Call StartEncryption (P1=&amp;amp;H12, P2=0, Rnd)&lt;br /&gt;
Rem End If&lt;br /&gt;
Rem Call CheckSW1SW2()&lt;br /&gt;
&lt;br /&gt;
Open Log File &amp;quot;issuer.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Call PersonaliseCard (Amount&amp;amp;, PIN$, Name$) : Call CheckSW1SW2()&lt;br /&gt;
Call SetWinRatio(Ratio&amp;amp;) : Call CheckSW1SW2()&lt;br /&gt;
&lt;br /&gt;
Rem Call EndEncryption() : Call CheckSW1SW2()&lt;br /&gt;
&lt;br /&gt;
Close Log File&lt;br /&gt;
&lt;br /&gt;
Print &amp;quot;Personalization successful.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Donsez</name></author>
	</entry>
</feed>