--------------- FIDO MESSAGE AREA==> TOPIC: 178 VISUAL BASIC Ref: E5300001 Date: 05/01/97 From: BUCKY CARR Time: 03:52pm \/To: LAWRENCE KELLIE (Read 6 times) Subj: ETHICS......... > (and I am not a lawyer, I "work" at a law firm) Still makes you "closer" to a lawyer than I am :). --- FLAME v1.1 * Origin: Purgatoire BBS, 719-846-0140, Trinidad, CO, V.34 (1:15/7) --------------- FIDO MESSAGE AREA==> TOPIC: 178 VISUAL BASIC Ref: E5300002 Date: 05/01/97 From: JIM BROADBENT Time: 01:46pm \/To: RICHARD LONES (Read 6 times) Subj: Subroutine headaches -=> Quoting Richard Lones to Jim Broadbent <=- Hi Richard; RL> Ah, the light dawns for me at last regarding the motivation for your RL> original question. I don't think now that you actually need DoEvents RL> as a part of your control structure at all, more likely you just need RL> to re-organize your routines in a way compatible with event-driven RL> programming. You are right...I've looked into DoEvents and it doesn't seem suitable. I have redone the subroutines and it is much cleaner now. RL> It sounds as though you're trying to control this program as one big RL> loop, from whence would come your concern about maintaining context at RL> the discontinuity arising from the human's move. Is this correct? Yep...I am still rather new at VB4.0 having been only been at it since January. For the most part I wanted to adapt as much code as possible from the Turbo Basic routine it was written in the first place. Eventually I gave up and started again from scratch. RL> It's quite simple if the human is the first player, since the end of RL> the human's turn can kick off a loop which runs the computer players, RL> including at last the dealer. I think it gets a little messier if the RL> human is not necessarily the first player, i.e., the player at the RL> dealer's left. Which is the case for your game? You don't really want to designate who plays where. I first started programming a Blackjack game in about 1983. I had my first computer then a laptop Epson HX20. I was a salesman then selling scientific instruments to occupational health/safety and environment industry. The Epson HX20 was one of the first laptops that completely independant (had a built-in printer, microcassette drive and LCD display with 20 characters by 4 lines :-0 ) It came with 16K of memory of which about 13K was usable for programs :-) It was used extensively with portable dataloggers of the day. As a salesman I was confronted by clients who wanted to know what "Video games" they could play on it. Well I knew the company wouldn't spring for any demo game (other than Hangman I don't think there was much available anyway) so I decided to create a Blackjack game. Believe it or not on a 4 line by 20 character screen and 13K of memory I actually had 3 players + the dealer...with all cards showing:-> 2 computer players at that time. It-was-a-hit. I gained instant credibility with clients. The Epson HX20 lasted about 2 years and CPM fellout of favour so I upgraded the game to Turbo Basic with very crude card graphics and now I want to make it a program of the 90's :-) As far as the game goes the seating is very important. I have 4 seats. The fourth is the anchor...if that player does not play properly his actions can kill the rest of the table's play. A lot of people don't like the anchor position due to this pressure. A good player (card counter especially) likes this position since they see more cards prior to them having to play. On the other hand the first position is my favourite in real life since you play first and your choices are unaffected by some bozo ahead of you. The game is excellent no-risk practice for the real thing. So a Human player may want to play anywhere. Regards Jim --- Blue Wave/Max v2.12 [NR] * Origin: RASCAL BBS [Calgary, Alberta - (403)686-2550] (1:134/122) --------------- FIDO MESSAGE AREA==> TOPIC: 178 VISUAL BASIC Ref: E5300003 Date: 05/01/97 From: JIM BROADBENT Time: 09:54pm \/To: RICHARD LONES (Read 6 times) Subj: Subroutine Cont'd -=> Quoting Richard Lones to Jim Broadbent <=- RL> Global NumberOfPlayers as Integer 'Including the dealer RL> Global HumanIndex as Integer RL> Sub DealButton_Click () ... RL> DealButton.Enabled = False RL> Call DealTheCards (NumberOfPlayers) RL> Call ComputerPlayers (1, HumanIndex - 1) RL> Call EnableHumanButtons () RL> End Sub Not sure this is the right approach. If I follow you correctly after dealing you automatically call up the computer player sub....no conditional as to whether this player is human or not. Enabling the human buttons is fine but you have to deal again to reach them for anothr human to play RL> Sub ComputerPlayers (FirstPlayer as Integer, LastPlayer as Integer) RL> Dim PlayerIndex as Integer RL> PlayerIndex = FirstPlayer RL> While PlayerIndex <= LastPlayer RL> Call ComputerPlayer (PlayerIndex) RL> PlayerIndex = PlayerIndex + 1 RL> DoEvents What is DoEvents going to do for me here? You again automatically call a computer player without knowing if the next is/isn't one. So I don't think I'm making it to the DoEvents instruction. RL> Sub ComputerPlayer (PlayerIndex) RL> Dim EndOfHand as Integer Would you dim it Boolean here? RL> EndOfHand = False RL> While EndOfHand = False RL> Select Case PlayersNextMove (PlayerIndex) RL> Case NEXTMOVE_HIT RL> If DoHit (PlayerIndex) = BUSTED Then EndOfHand = True RL> Case NEXTMOVE_STAY RL> Call DoStay (PlayerIndex) RL> EndOfHand = True RL> . . . etc. RL> End Select RL> Wend RL> End Sub under this it seems you play one computer player and then are kicked out of the routines with only a redeal to bring you in again RL> Finally, for example . . . RL> Sub HitButton_Click () RL> If DoHit (HumanIndex) = BUSTED Then RL> Call DisableHumanButtons () RL> Call ComputerPlayers (HumanIndex + 1, NumberOfPlayers) RL> Call Payoffs () RL> DealButton.Enabled = True RL> End If RL> End Sub Not sure what button you are hitting here. Actually I've fine tuned this thing to the point where it works reasonably well now. I'll give you a thumbnail sketch of it. First of all my Cplayers are identified by name....they are FREDD, FREDA and FREDY....FRED standing for Feaking Ridiculous Electronic Device :-) Each player has their own routines for play and betting. So the game goes as follows: |-------------------------| | Players make their bets | | (here I let the CPlayers| | go first as it isn't NB | | who bets first) | |-------------------------| | | dealing starts automatically | after last bet made- the bet | container disappears to be | replaced with new container with | "Play" enabled but Hplayer buttons disabled | |----|-----------------------| | dealer deals 2 cards to | | each player & 1 to himself| iPos is form level int | iPos = 1 (1st player loc) | |----------------------------| | Diagram for Play sub | (Someone has to press "Play") ~~~~~~~~~~~~~~~~~~~~ | |---------->-----| |---|------| |---------------<-------------------<---------| | Increment| / \ | | iPos | / \ yes | |---|------| / iPos > 4 \------> Payoff players & start new | | \ / deal | | \ / | |---|------| \ / | | Cplayer | | | | auto play| no | | |----------| |-------<-----| | | / \ | this is an endless loop | | yes / \ | the human play options | |-<---------/ Cplayer? \ | are enabled, "play" is | \ / | disabled. You stay in | \ / | the loop til a Hplayer | \ / no | whose turn it is presses | |-------->----| a play option button | now play is janked out of | "Play" subroutine. | | For Double Down, split and hit the control stays at the form waiting | for another Hplayer option button to be pressed (controling their | options by enabling/disabling appropriate keys). | | However....when the Hplayer presses "Stay" or "Busts" then iPos is | incremented then and last statement before the End Sub is: | | Call Play_Click() ^ | this brings you back into the "Play" subroutine with an incremented | iPos value and the cycle repeats until iPos is > 4 ----->----->------| That explains my current method....any further ideas are appreciated Regards Jim --- Blue Wave/Max v2.12 [NR] * Origin: RASCAL BBS [Calgary, Alberta - (403)686-2550] (1:134/122) --------------- FIDO MESSAGE AREA==> TOPIC: 178 VISUAL BASIC Ref: E5300004 Date: 05/02/97 From: KURT J. TISCHER Time: 09:18am \/To: LOU MOSQUERA (Read 6 times) Subj: need help LM>hey everbody, how's it going? I need some information from somebody who LM>knows if there is some sort of code to make a program that on makes LM>automatically format to fit any users screen. I designed a program on You need to set the scale mode property of all forms to pixels. kjt * SLMR 2.1a * Backup not found: (A)bort (R)etry (P)anic --- SLMAIL v4.5a (#4334) * Origin: TEST FOR ECHO BBS - Middleburg Hts., OH (216) 234-6088 (1:157/438) --------------- FIDO MESSAGE AREA==> TOPIC: 178 VISUAL BASIC Ref: E5300005 Date: 05/01/97 From: FRANK SCHNEIDER Time: 10:43pm \/To: EILEEN LOUISE (Read 6 times) Subj: VB & HPIB control Hallo Eileen, GJ> HPIB is Hewlett Packard Interface Buss compatable test GJ> equipement. It follows the IEEE 488.2 standard. GJ> My place of employment currently uses VB to control test GJ> equipment. I'm just starting off learning on my own before EL> kewl. i don't know a thing about that (beyond what test equipment EL> is) but would love to learn! as far as I remember, there is something quite VB-like form HP which does the job quite well.. Frank. --- * Origin: the only things that looks good on you is me! (2:2444/1250)