BlackJack von Frank Abbing
Projekt BlackJack-Light-Demo
(C) 2008 by Frank Abbing
http://frabbing.de
Set(ErrorLevel, -1)
Declare cards&, x&, y&, text$, a&, b&, n&, m&, ende&, dialogfont&
Declare breite&, hoehe&
Declare karten#, augen#, wingdings&, smile$
Declare textaugen&, textguthaben&, kartenehmen&, genug&, textaugengeber&
Declare guthaben&, anzahl&, geberanzahl&, computerspielt&
Dim karten#,52
Dim augen#,52
Def cdtInit(2) ! cards,cdtInit
Def cdtDraw(6) ! cards,cdtDraw
Def cdtTerm(0) ! cards,cdtTerm
Def GetSysColor(1) ! USER32,GetSysColor
Def LoadIcon(2) !USER32,LoadIconA
Def GetTextExtentPoint32(4) ! GDI32,GetTextExtentPoint32A
Randomize
____________
Prozeduren
¯¯¯¯¯¯¯¯¯¯¯¯
Proc Karten_mischen
WhileLoop 52
Byte karten#,(&loop-1)=(&loop-1)
EndWhile
Play 0;0;0;75,0,0
WhileLoop 250
x&=Rnd(52)
y&=Rnd(52)
a&=Byte(karten#,x&)
b&=Byte(karten#,y&)
Byte karten#,y&=a&
Byte karten#,x&=b&
EndWhile
EndProc
Proc Augen_initieren
Byte augen#, 0 = 11,11,11,11,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6
Byte augen#,24 = 7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10
Byte augen#,48 = 10,10,10,10
EndProc
Proc Gummi_alle
If guthaben&=-1
MessageBox(Dein Guthaben ist aufgebraucht.
Der Geber ist gut aufgelegt und sponsort
dir nochmal 25 Sterne ;-).,Info:,4096)
guthaben&=24
Endif
EndProc
Proc MessageBoxNew
Parameters tex1$,tex2$
Declare dialog&,font&
EnableWindow %hwnd,0
font&=Create(Font,Arial,16,0,0,0,0)
dialog&=Create(Dialog,%hwnd,tex2$,%maxx,%maxy,212,120)
SendMessage(dialog&,$80,1,LoadIcon(0,32517))
x&=Control(STATIC,tex1$,$54000000,8,8,192,90,dialog&,0,%hInstance,$0)
SetFont x&,font&
SetWindowPos dialog& = ((%maxx/2)-106), ((%maxy/2)-60) - 212, 120; -1
Repaint
Sleep 2750
EnableWindow %hwnd,1
DestroyWindow(dialog&)
DeleteObject font&
EndProc
Proc paintCard
Declare ktext$,kb&,kmod&,kcol&,kpie&,ksize#
Dim ksize#,8
Parameters kx1&,ky1&,kx2&,ky2&, kpos&
StartPaint -1
Cls
If kpos&<>-1
kcol&=0
kmod&=kpos& MOD 4
Case ((kmod&=1) or (kmod&=2)):kcol&=Rgb(255,0,0)
ktext$=AAAA222233334444555566667777888899990000BBBBDDDDKKKK
RoundRect 0, 0 - kx2&, ky2&; 8,8
ktext$=Mid$(ktext$, kpos&+1, 1)
Case ktext$=0: ktext$=10
Usefont Times New Roman,36,0,0,0,0
TextColor 0,-1
DrawText 4, 2, ktext$
kpie&=GetTextExtentPoint32(%hdc,Addr(ktext$),Len(ktext$),ksize#)
kpie&=Long(ksize#,0)+6
ktext$=§
Case kmod&=1:ktext$=¨
Case kmod&=2:ktext$=©
Case kmod&=3:ktext$=ª
Usefont Symbol,36,0,0,0,0
TextColor kcol&,-1
DrawText 4, 26, ktext$
Usefont Symbol,24,0,0,0,0
TextColor kcol&,-1
DrawText kpie&, 2, ktext$
Usefont Symbol,148,0,0,0,0
TextColor kcol&,-1
DrawText 4, (-10), ktext$
Else
UseBrush 7,0
RoundRect 0, 0 - kx2&, ky2&; 8,8
EndIf
EndPaint
MCopyBmp 0,0 - 71,96 > kx1&,ky1&; 0
Dispose ksize#
EndProc
cards&=UseDll(cards.dll)
IfNot cards&
MCls 71, 96
Endif
_______________________________________________________________________________
Start des Hauptprogramms
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Windowstyle 31 | 512
WindowTitle BlackJack Light für XProfan10 und höher.
Window ((%maxx/2)-320),(((%maxy/2)-200)/2)-640,495
Cls GetSysColor(15)
SendMessage(%hwnd,$80,1,LoadIcon(0,32517))
_______
Intro
¯¯¯¯¯¯¯
If cards&
cdtInit(Addr(breite&),Addr(hoehe&))
Else
breite&=71
hoehe&=96
EndIf
Play 0;0;0;0;0;37,0,0
Play 61,0,0
WhileLoop 250
If cards&
cdtDraw(%hdc,Rnd(640)-(breite&/2),Rnd(480)-(hoehe&/2),Rnd(52),0,0)
Else
paintCard(Rnd(640)-40,Rnd(480)-50, 71, 96, Rnd(52))
EndIf
Case &loop=50:Play 0;56,0,0
Case &loop=100:Play 0;0;53,0,0
Case &loop=150:Play 0;0;0;0;49,0,0
Sleep 5
EndWhile
Declare mem#
Dim mem#,5500
Clear mem#
Long mem#,0=944130375,19751225,16187508,489019648,-635558182,668671783,522705951,-568383523,685645607,539549472
Long mem#,40=-551474721,736043562,606854947,-551211809,786441773,640606246,-534302752,836773936,707977257
Long mem#,76=-517262368,903949364,775348525,-516999199,971059256,842719793,-499958814,1021457468,893248052
Long mem#,112=-499761438,1088632638,960553785,-482721309,1138965571,1011082044,-465746717,1189363269,1078453311
Long mem#,148=-465483548,1256473161,1145824579,-448443163,1323648589,1213195591,-448179995,1374046544,1263724106
Long mem#,184=-431205402,1441156436,1331095118,-430942234,1491489112,1398400594,-430679322,1558599003,1465771862
Long mem#,220=-413638937,1625774431,1533142874,-396598553,1692949859,1583671390,-396401176,1743282278,1651042401
Long mem#,256=-379360791,1810457706,1701570917,-379163415,1844012909,1768876648,-362123286,1911188336,1819404908
Long mem#,292=-361925910,1961586291,1886776175,-344819733,2028696440,1954147187,-327845140,2095871611,2021518455
Long mem#,328=-327581972,-2131920257,2088889723,-310541587,-2081587582,2139417983,-293566995,-2031255419,-2088243838
Long mem#,364=-293304083,-1964079991,-2020872827,-293040658,-1913747315,-1970344311,-292843537,-1846637424
Long mem#,396=-1902973299,-275868945,-1796239469,-1852444784,-275605777,-1729129577,-1785073516,-258565392
Long mem#,428=-1661954149,-1717702504,-241525008,-1611555937,-1667239524,-241327887,-1561223519,-1599868513
Long mem#,460=-224287502,-1494048091,-1532497245,-224024334,-1426872663,-1465125977,-206983949,-1376539987
Long mem#,492=-1414597718,-190009357,-1309364816,-1347291986,-189746188,-1242254925,-1279855182,-172705803
Long mem#,524=-1191856713,-1212549706,-155665675,-1124681285,-1145178438,-155402506,-1057571393,-1077807426
Long mem#,556=-155205130,-990461757,-1027213631,-154941706,-923286329,-976685115,-137967113,-889731127,-909379640
Long mem#,592=-120926985,-822555699,-825231156,-120598280,-755445551,-757859887,-103557895,-705047339,-707331628
Long mem#,628=-103426055,-637872424,-656737577,-86385670,-587539748,-606209318,-69411078,-537141794,-538838050
Long mem#,664=-69148165,-470031902,-471532318,-52107780,-402856474,-404161306,-51779076,-352458263,-353698327
Long mem#,700=-34870019,-302125843,-286261779,-1052419,-251662609,-252575761,-920833,-184552717,-101057805
Long mem#,780=11264,19726336,134217844,165740798,-1599059940,319325121,-1329046486,277332897,1218202147,-1949982031
Long mem#,820=-597019880,-945573432,-1975312241,-1531819748,1395168201,-1295426390,815254437,1234698815,-1681021261
Long mem#,856=-588614856,-811093047,176373919,-1464579555,-1991728175,-1261810662,1353175977,1251822243,-1429018763
Long mem#,892=-2064993448,-696090080,511008943,1084350696,1761979224,-1228762878,1371003821,-523181940,-1143225997
Long mem#,928=-316923822,175044480,-1193793116,1617864362,-222861126,-1229340500,940366639,191772825,609108005
Long mem#,964=-258431597,347284745,1210402851,-598948687,-2133166144,-530431395,952928422,753974896,-1412611099
Long mem#,1000=-733120512,1321724406,476253202,1441846421,-1570700719,-964273099,1267035814,677978734,-2051709111
Long mem#,1036=1760197232,1363349224,-19092198,-373877711,187878721,1883561289,121020813,2093929399,-1982369458
Long mem#,1072=169328796,1543526959,202798787,259163573,1121772257,-2146118191,326175793,-170363519,1799588100
Long mem#,1108=713209100,1584432401,-775866502,-516549232,-398123194,2119401728,340258058,295505683,1218183700
Long mem#,1144=592273508,1293980702,-978045863,-1809197234,2013548253,1110429923,1150185817,-1635462630,81128002
Long mem#,1180=-854884479,411603826,1304609685,-492558808,-1271094448,68898827,881643827,-1915721515,220206080
Long mem#,1216=-722422205,-364952989,591660180,549459196,-751229676,1228212626,-1458823021,-225945165,760321765
Long mem#,1252=-1806236072,-197334781,1228762510,1682246912,1298171854,-827051926,-1203356577,-586143725,354587633
Long mem#,1288=-1627387415,1074395400,-735164666,1426017799,1300452454,1706304089,876895824,-872198329,-2035986094
Long mem#,1324=51595074,1210331356,337801039,-1274196441,1043501290,-1450090111,-358343000,-2092626908,-1702515712
Long mem#,1360=-1272983223,-1349236182,332601616,673103785,813386988,-939356860,382966394,-1816085230,-1164606195
Long mem#,1396=-1724607711,-1606218032,-1722791055,-1940677366,-1808735438,301643850,293110181,181642797,1856656144
Long mem#,1432=1348077890,-129350898,-884872044,1149961438,-873140092,947049541,-1458820845,-1765742518,1288430630
Long mem#,1468=-1899930623,1423389506,-21544469,-532363548,1170892010,1347123904,-2077193086,455036874,407728660
Long mem#,1504=894508028,81061270,200485190,753863936,962399812,-833582395,1352825139,1218907182,1158885588
Long mem#,1540=403493795,136936725,1315187947,2076920839,352197331,5476589,1874682056,-1416547425,-1050141936
Long mem#,1576=903408668,642812833,1413049193,-1738470902,624496080,1479250146,155271320,743583812,-620006852
Long mem#,1612=7422729,1329689813,1109796051,1223959446,876097614,1546853389,1846378928,-699387136,1354830724
Long mem#,1648=1042547505,254984464,-1455256325,1349397739,-793895809,-1019659998,241711376,-1522890725,-985469853
Long mem#,1684=-2143084280,1691843306,947208834,-986230677,1128756447,326473875,-1627272685,728498282,-965980428
Long mem#,1720=1111262219,394449105,-2069450506,-1862114412,38835635,-1266381520,-787871997,1382940806,-1548188158
Long mem#,1756=-2116994296,-1870254551,560116773,1346494703,-695187626,168796161,338870977,571355154,2033914788
Long mem#,1792=1743530880,-2077218131,-1693369070,-1466894779,996476294,1178205705,275234819,1585765409,1329922315
Long mem#,1828=-2052897312,-1742655944,118032912,625590882,1261176324,846079688,-2078662144,-1981804004,-1532798464
Long mem#,1864=2036507781,407300362,-1975278983,-817569260,310692347,-469759726,-1198055153,-501736375,1830330651
Long mem#,1900=-934610656,-1036862409,115658226,8855818,1913689848,405192740,-2062268320,75705682,-262332110
Long mem#,1936=-501146807,19945102,1240232255,93459600,556606464,1300248802,1430389008,1629680122,85248536
Long mem#,1972=675723986,1532696068,-496233336,1635812866,143430952,-911051600,266561671,262471725,-2054905217
Long mem#,2008=185239656,1649246833,275779748,-787640347,-385166010,1131818531,31009,-1872243711,2017777165
Long mem#,2044=805454091,-1618722257,-1037946092,-720420448,676369414,-516744412,1178779903,-1400517327,-1263567773
Long mem#,2080=1768167304,606872520,-2053033208,396481602,-1802264422,755545323,2017450422,-350040068,2030191232
Long mem#,2116=-1610181626,-1600511677,-2112605367,-455866738,1337527313,238168896,449119676,1113273478,2994640
Long mem#,2152=1596023252,403540392,1518897154,-325448412,-2117056874,-1288837374,139216935,1264740374,648112261
Long mem#,2188=352870524,2018345606,-1323203688,-1153971696,-1878682791,-1665654605,571870473,-2138269045,703638817
Long mem#,2224=-1866813886,-2027909005,801656130,167780356,175431900,-380533487,630297577,-1609097756,-1844047159
Long mem#,2260=-2125948330,681622049,-784298930,-1950225750,1346580742,475384382,873325613,278134801,-759132446
Long mem#,2296=1761979372,-1837806969,1368750849,-1653037535,-660507070,1905640745,1112867125,1059182846,550300672
Long mem#,2332=101305149,1896889120,1958207952,-666725440,1419379025,-797302384,-517733495,698226446,-2026828782
Long mem#,2368=7503368,365724806,1879353611,-2067439383,193569192,1934198297,-2140174990,-897731352,-770255039
Long mem#,2404=-155295172,-1986304992,674371093,157561563,2125449249,838999031,-1843170766,360139173,-767424206
Long mem#,2440=-260767100,1536965071,542123408,1170803740,-2138046101,-1863878568,1290799372,-1925898194,2032575220
Long mem#,2476=1815201896,671191904,1154643425,536914543,1134855507,-1464003323,778817,149171254,1148041524
Long mem#,2512=-721417756,879559786,-834436063,-532018239,-390721151,2081961968,-1973157836,-1983877599,-1924014056
Long mem#,2548=14684195,784883880,-1895394711,723941196,1177749624,-2076080191,1760605026,-29840927,716571060
Long mem#,2584=334305316,107147736,1083480539,-774304997,286028876,599826041,-1908346641,1813072955,-786400976
Long mem#,2620=405946393,748409922,-1461510054,1350189851,-998744301,97072398,666434118,563068309,2077953249
Long mem#,2656=1007514125,-1424948768,1883386912,-930322500,1763607827,1504182319,1511811089,-1468397280,1729199682
Long mem#,2692=570091520,1207154224,563302802,-2096683936,268448091,-1333411632,1453458947,-1843178148,1147098828
Long mem#,2728=149554334,31615537,419715186,-1916303689,1360056658,293856465,1719912313,-1198520414,-1196743008
Long mem#,2764=1233295048,-1589559536,-484391391,951903947,-1687985012,218660476,1620183072,369894607,1874347529
Long mem#,2800=575373876,116333924,198576640,-992715247,372842362,233844813,-847505269,759798618,-234905062
Long mem#,2836=-829424771,1589920024,-1501347285,907003006,-2142944087,-718019796,554416196,417749382,-1529978991
Long mem#,2872=111223046,-383745211,-742818679,192939809,1989180756,384093792,474331461,-460688716,-787895456
Long mem#,2908=-826922682,-1769755019,-1985038816,-1857991168,1662485170,-1644142283,-1350493575,1672235,404930565
Long mem#,2944=2007927474,-787774083,-1062580863,226527092,162235625,1398726607,573815962,-714587929,-2056584665
Long mem#,2980=-400080360,1789708374,1069645874,-1224010396,1677596489,-1551333169,-1072090200,230823478,561043613
Long mem#,3016=298432654,68234684,911923370,328859801,-676853598,282403420,-1843050783,745833709,1214279463
Long mem#,3052=103968802,346308566,-909092967,-2018979302,881001392,-129826263,873173913,-1100949592,-1877589021
Long mem#,3088=-604055444,2030881700,1057858823,-2090301206,2111589391,1857150023,1036044444,122272787,403756898
Long mem#,3124=931380638,-1715142215,814156564,-1321859485,483462153,174649658,1094143697,833648128,-194260721
Long mem#,3160=53350454,282495488,-469712686,1116630311,208721678,1057460387,651583792,329702162,123797505
Long mem#,3196=-1339026523,1091766537,-144555886,557327207,63182464,125374524,-1870459471,10564478,-720328692
Long mem#,3232=-1758588010,328437776,587685905,1085100213,-2131675642,8458498,1945136224,376896641,85235796
Long mem#,3268=276169760,212909834,-1442045740,1081477408,363339779,-1794801640,1086524176,178307853,-670793586
Long mem#,3304=-1858370217,153118210,-737382216,-1330443088,83919625,8849430,410917760,-2009562488,1921538180
Long mem#,3340=-1736019338,-1198850168,351833224,369983928,1095783377,884020993,-2013036206,-250339632,119586318
Long mem#,3376=-468392121,-525463210,1234245198,806195512,-2007889903,291016840,-1810564974,-392818328,96470292
Long mem#,3412=-284053307,134220384,-1976494454,-1508813503,-123202696,322480658,1367939215,823495441,1132939
Long mem#,3448=512413795,-1749415151,289972500,-1068037954,-389868648,-2013739758,328008325,-1588688143,-1933503348
Long mem#,3484=-637284025,1620447751,-1924052962,1821208851,-1730508204,1964551050,311296000,1095601697,-1906240626
Long mem#,3520=-1912569532,-254274960,-1897838981,361693458,1757483285,316201747,-1366525731,-2003465064,208677652
Long mem#,3556=1862873386,419828744,1592330257,-192251687,-1998615448,-1858563188,1023693126,-1062399336,-1850653571
Long mem#,3592=-778972912,1493897542,-921829613,-1841754350,-1299031791,1885148264,203500851,773072286,2033193209
Long mem#,3628=-1825500536,731074868,-2088070287,-1885269617,311411020,-2126540831,217133318,-1114364475,689932872
Long mem#,3664=-1914101364,-1332590259,1900188264,317192965,1064849596,-1013214159,-1892076907,881809604,17863905
Long mem#,3700=-1792980587,1016414481,390399025,-2043632621,227983672,-709979055,-1778840427,1980844304,158864521
Long mem#,3736=329873937,824451099,-1557852095,-1946592367,1905396079,-1721658839,-1816566893,-1711263424,-251356874
Long mem#,3772=-1721745906,328657058,-1590455167,-1799279980,261572348,-783837007,-1729032296,-1543012040,-1060040599
Long mem#,3808=-1742652014,1352155404,-915369817,322531981,-1273960014,-373943191,325695504,-1151778785,-408350647
Long mem#,3844=280608787,-2044782142,-1987538103,696975251,334078097,94189412,-242217567,-1920362597,-1684674151
Long mem#,3880=699504137,-1773608042,-462405316,820645641,-1852814838,-241264255,-649486920,-1644585571,1066187066
Long mem#,3916=1897766449,199299734,1803472997,151625673,633873,-1340958290,-1175418167,329904783,-468605165
Long mem#,3952=1347226064,4197378,1996734495,1628394240,2046853389,178090307,1224056209,-1670800740,-1633748580
Long mem#,3988=-1176396007,295138067,930799769,1616248865,242289026,-2147209059,-1985372535,-1671844967,-140740338
Long mem#,4024=-1722703496,2177185,-317626517,826082640,275298050,1577804015,-387097040,-1632035168,-1986078329
Long mem#,4060=1239453209,68238496,-1525751528,1343296484,220267072,-729157509,-1060433560,-1483048954,396864122
Long mem#,4096=-802643695,-1474658302,-911734142,814747865,-628555864,-1504100094,-442074887,2030113752,336629009
Long mem#,4132=-468803534,-120387232,318385172,1880353297,97063226,-1795519468,1032837774,-2129256255,335175181
Long mem#,4168=1350803503,-785471055,-1443807831,-1431695086,-897216663,-1791318701,134287676,-1842474726,316321928
Long mem#,4204=-1273771342,-1967779558,-1528121180,916785527,-2129232607,-2006643442,-988624189,180818874,-1632974575
Long mem#,4240=413358614,-247946374,1151407460,-1845251784,-1696027024,-1363481938,1403964140,-1160440928,329963282
Long mem#,4276=-619644199,708091866,-1500930144,357200186,-2127057903,154215024,94329584,1362734897,-1351545169
Long mem#,4312=-862157263,1523488970,292596755,598743086,1795492321,-1333722192,229679416,-631131967,-1553270099
Long mem#,4348=1041472252,1252921654,303759891,716118415,-516443711,365494193,-1755667692,1016568507,-1860929663
Long mem#,4384=-1297008114,781730080,1798312603,280703507,580066080,-100424085,-1570686040,1024303380,-1249570245
Long mem#,4420=271260319,1158896451,1799819435,-1325829228,884021685,-518743775,304828684,1091802490,1263997579
Long mem#,4456=278616339,-107455653,-889473878,-1416545612,963141899,1629467617,-1252321015,1829976939,1802440843
Long mem#,4492=-1377104261,934152783,1628734577,303785230,1438025667,289846635,-1204746312,-1917380134,-1163479878
Long mem#,4528=292602387,2048092017,45027819,-1208249927,112803840,1783413089,-1666118985,228380997,1890557169
Long mem#,4564=324476689,-2012095583,998160963,-1163848007,-1716217293,-1415858373,291842067,582051450,-1152095551
Long mem#,4600=-1165933125,-289677051,-1432044535,331005113,-720280769,18988169,-1417806078,-1125407055,901579012
Long mem#,4636=-348677317,1288780952,-1626492650,1898099371,-1231527154,-1111625433,702460747,-1219812169,402743609
Long mem#,4672=1899496689,1889606587,-223319075,1541542235,-1082408513,-871126077,-792850064,176178266,297868304
Long mem#,4708=1092094908,-1621360208,85019651,-67723236,328934829,1829861170,2035684368,-1049321711,168497424
Long mem#,4744=-601046352,-1478742590,-188724292,-518864437,-1016062712,985898040,-1608662084,-1241118826,381583668
Long mem#,4780=-411431311,-1517289197,-1106341611,2028977337,340406443,454048736,-1591166580,-1157548210,85185354
Long mem#,4816=1628808192,330734606,1393650321,-1404191829,339496876,1393568849,1629994284,-981387579,865923339
Long mem#,4852=-786888351,-1597993970,-1778327242,-1067249337,-1561595885,831814591,1278460332,-1938948155,279736339
Long mem#,4888=1073745010,-1864298073,29380617,486552746,1619657664,233903740,130337867,974177513,-933584696
Long mem#,4924=1846701164,-1668738212,822032,-485365981,-336365616,-1265999673,-1346577278,-883053700,-1006852846
Long mem#,4960=-804021368,-1327122150,-940491962,420543646,1789053468,-930327104,-1240241088,1357953296,-887307918
Long mem#,4996=1120303430,-1326397807,-880096314,969653450,1765671617,-1008677968,1724505188,750045692,-1018378301
Long mem#,5032=-876249911,877597548,2033249693,-1014142394,1556418796,-845372757,868978987,-1861694863,9515978
Long mem#,5068=-1365290111,1556222811,-905132850,-2033279752,-52704692,44121537,-1106061458,1559452496,-885334842
Long mem#,5104=-892642224,-50607238,335280336,766242906,-648475391,-778418272,-703324972,-1390490228,217906962
Long mem#,5140=276626944,1913871616,1356765760,-761701886,-408642824,1024247884,-753850934,890268979,277287773
Long mem#,5176=1820387347,147803451,-1928671379,-755172948,-304856791,-259976276,-725557998,1037143373,-865545811
Long mem#,5212=-716367407,1472658667,-1067052115,217130075,-762129041,-1119963380,-882054959,-321782907,1900072396
Long mem#,5248=309811204,727736506,1774442234,-737316146,-626729612,1024513916,186652692,1947111719,-316104800
Long mem#,5284=-668128556,500645217,221304669,342624722,1644584961,817500699,-670497446,-1781064809,1838667853
Long mem#,5320=-697469224,286539128,-589363008,100716305,1591286341,-49700611,-665008429,1444023212,-1320887587
Long mem#,5356=442533121,1443651867,1900838672,-610430000,-1445216893,-249570339,345868763,-1324998643,-787559712
Long mem#,5392=1083467789,-632639580,-707179985,-580921812,323871880,-1777999851,1831079088,197190928,-939274103
Long mem#,5428=-1913463203,-549945323,906041485,276301184,170957065,-1727373139,276760768,36720135,148860341
Long mem#,5464=-1644882786,-522318624,-837468658,1041424668,-513927967,417431062,-1105534562,319692001,989856001
text$=$TempDir+/bjlogo.gif
FileMode 1
Assign #1,text$
OpenRW #1
BlockWrite #1,mem#,0,5500
CloseRW #1
Dispose mem#
Play 0;0;0;85,0,0 85
WhileLoop 10
DrawPic text$, 170, 182; 4
Sleep &loop
DrawPic text$, 170, 182; 0
Sleep &loop
EndWhile
Sleep 4000
Cls GetSysColor(15)
___________
Initieren
¯¯¯¯¯¯¯¯¯¯¯
wingdings&=Create(Font,Wingdings,24,0,0,0,0)
dialogfont&=Create(Font,Arial,16,0,0,0,0)
SetDialogFont dialogfont&
Augen_initieren()
text$=GetEnv$(UserName)+:
Create(Text,%hwnd,text$,8,8,300,16)
textaugen&=Create(Text,%hwnd,,8,hoehe&+40,640,16)
textguthaben&=Create(Text,%hwnd,,8,hoehe&+60,640,48)
SetFont textguthaben&,wingdings&
kartenehmen&=Create(Button,%hwnd,Noch eine Karte aufnehmen,8,hoehe&+104,180,24)
genug&=Create(Button,%hwnd,Genug,8+188,hoehe&+104,80,24)
Create(Text,%hwnd,Geber: ,8,hoehe&+144,640,16)
textaugengeber&=Create(Text,%hwnd,,8,hoehe&+hoehe&+184,620,16)
text$=Gespielt wird eine abgespeckte Version von BlackJack, Bei Gleichstand gewinnt immer der Geber. Das Ass zählt immer 11. Split, Double, Bust und Insurance sind nicht erlaubt. Ausgezahlt wird immer 1:1.
Create(Text,%hwnd,text$,8,hoehe&+hoehe&+216,620,48)
guthaben&=24
_______________
Spiel starten
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Karten_mischen()
anzahl&=2
geberanzahl&=1
computerspielt&=0
SetFocus(%HWnd)
ende&=0
While ende&=0
Play 0;0;0;70,0,0
m&=0
Whileloop anzahl&
m&=m&+Byte(augen#,Byte(karten#,(&loop-1)))
EndWhile
SetText textaugen&,+Str$(m&)+ Punkte. Dein Einsatz ist ein Smilie. Verbliebene Smilies:
smile$=L
Case m&>=12:smile$=K
Case m&>=17:smile$=J
Case m&>21:smile$=L
text$=MkStr$(smile$,guthaben&)
SetText textguthaben&,text$
Whileloop anzahl&
If cards&
cdtDraw(%hdc2,8+((&loop-1)*(breite&/2)),32,Byte(karten#,(&loop-1)),0,0)
Else
paintCard(8+((&loop-1)*40), 32, 71, 96, Byte(karten#,(&loop-1)))
EndIf
EndWhile
n&=0
Whileloop geberanzahl&
n&=n&+Byte(augen#,Byte(karten#,(&loop-1)+10))
EndWhile
If geberanzahl&=1
If cards&
cdtDraw(%hdc2,8,hoehe&+168,1,3,GetSysColor(3))
Else
paintCard(8, hoehe&+168, 71, 96, -1)
EndIf
SetText textaugengeber&,Sein aktueller Kartenwert ist dir unbekannt.
Else
Whileloop geberanzahl&
If cards&
cdtDraw(%hdc2,8+((&loop-1)*(breite&/2)),hoehe&+168,Byte(karten#,(&loop-1)+10),0,0)
Else
paintCard(8+((&loop-1)*40), hoehe&+168, 71, 96, Byte(karten#,(&loop-1)+10))
EndIf
EndWhile
SetText textaugengeber&,Sein aktueller Kartenwert beträgt +Str$(n&)+ Punkte.
EndIf
Case cards&: Repaint
If m&=21
MessageBoxNew(BlackJack!
+GetEnv$(UserName)+ gewinnt den Einsatz.,Info:)
Inc guthaben&
ElseIf m&>21
MessageBoxNew(GetEnv$(UserName)+ hat überkauft und verliert.
Geber gewinnt den Einsatz.,Info:)
Dec guthaben&
EndIf
If m&>=21
Karten_mischen()
anzahl&=2
geberanzahl&=1
Gummi_alle()
Cls GetSysColor(15)
CONTINUE
EndIf
SetTimer 500
While ende&=0
WaitInput
If %key=2
ende&=1
BREAK
EndIf
If computerspielt&
If n&=21
MessageBoxNew(BlackJack!
Geber gewinnt den Einsatz.,Info:)
Dec guthaben&
ElseIf n&>21
MessageBoxNew(Geber hat überkauft und verliert.
+GetEnv$(UserName)+ gewinnt den Einsatz.,Info:)
Inc guthaben&
EndIf
If n&>=21
computerspielt&=0
Karten_mischen()
anzahl&=2
geberanzahl&=1
Gummi_alle()
Cls GetSysColor(15)
EnableWindow kartenehmen&,1
EnableWindow genug&,1
BREAK
EndIf
If ((n&>=m&) and (geberanzahl&>1))
text$=GetEnv$(UserName)+ hat +Str$(m&)+ Punkte.
text$=text$+Geber hat +Str$(n&)+ Punkte.
text$=text$+Geber gewinnt den Einsatz.
MessageBoxNew(text$,Info:)
Dec guthaben&
computerspielt&=0
Karten_mischen()
anzahl&=2
geberanzahl&=1
Gummi_alle()
Cls GetSysColor(15)
EnableWindow kartenehmen&,1
EnableWindow genug&,1
BREAK
EndIf
Inc geberanzahl&
BREAK
Else
If Clicked(kartenehmen&)
Inc anzahl&
BREAK
ElseIf Clicked(genug&)
computerspielt&=1
EnableWindow kartenehmen&,0
EnableWindow genug&,0
EndIf
EndIf
Endwhile
KillTimer
EndWhile
_____________
Deinitieren
¯¯¯¯¯¯¯¯¯¯¯¯¯
If cards&
cdtTerm()<
FreeDll cards&
EndIf
DeleteObject dialogfont&
DeleteObject wingdings&
Dispose cards#
Dispose eyes#
End