Puqi Luo
Puqi Luo

Reputation: 1

The program I'm writing seems to require an unnecessary extra end; what is it closing?

I am writing a program to count chips in a poker game. The issue lies in the four ends in a row near the end, I don't understand what I'm closing with the fourth end. I've indented it to show what I think is happening and have bolded the "extra" end in question.

0->Y:1->N
For(H,1,dim(LH
   LH(H-Y)->S
   Repeat N
      1->N
      ClrHome
      prgmINFOHEAD
      prgmSTRING
      Output(3,1,Ans
      Output(3,10,LCHIPS(S
      Output(3,14,LIN(s)+LBET(S
      max(LBET)-LBET(S->V
      Output(5,1,V
      prgmSETC
      Output(5, C, “TO MATCH
      For(x,1,5
         Disp “”
      End
      Input “BET: “, B
      If B>LCHIPS(S) or B<0:Then
         Output(8,11,”ERROR!
         0->N
         Pause
      Else: If B<V and B≠LCHIPS(S:Then
         If B=0: Then
            X-Y->F
            prgmFOLD
            Y+1->Y
         Else
            Output(8,11,”ERROR!
            0->N
            Pause
         End
      End
   End
   **End**
   LCHIPS(S)-B->LCHIPS(S
   LBET(S)+B->LBET(S
End

Here is my logic: The first end closes the nested if statement; he second end closes the enclosing if statement; he third end closes the repeat started at line 4.

I can't figure out what the fourth end is supposed to be closing, but my program only works with it there.

Upvotes: 0

Views: 15

Answers (0)

Related Questions