iPoetDev / MiniTicTacToe

MiniTicTacToe - NativeJS: UI - Client Controller - OOP Model/'Server'
https://ipoetdev.github.io/MiniTicTacToe/
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

BUG :: DRAW STATE is indeterminate: GameLogic._checkOutcome Conditionals #15

Open iPoetDev opened 8 months ago

iPoetDev commented 8 months ago

BUG: DRAW STATE is indeterminate: GameLogic._checkOutcome Conditionals

Label the Bug | Component| Feature Name: | File Name | Line No:

Related

Bug Outline

A clear and concise description of what the bug is.

I can declare a winner
I can not determine a draw state based on current logic and checks in GameLogic._checkOutcome() method
I am seeing that when there is checkSequenceWin === False, then Next Turn is always returned.
Further debugging is needed, however time is pressing for deadline submission in 15 hours.

Bug Behaviour

Reproducibility

  • [ ] Is It: Yes

Steps to reproduce :

  1. Go to 'Game Board'

  2. Click on ' The following sequenece' is technicall and visually a draw Cell 1: O Cell 3: X Cell 4: O: Cell: 7: X Cell 6: O Cell 2: X Cell 8: O Cell 5: X

  3. Scroll down to '....'

  4. See error in screenshot and Mermaid Flowchart

BUG - DRAW STATE is indeterminate GameLogic_checkOutcome

flowchart TD
    H2([sequence in\n WIn Combination])
    H2-->I(CheckOutcome)
    I-->|TRUE, FALSE|I0{CheckSequenceWin}
    I0-->|TRUE: :IF &&\n ! IFDRAW|I1([checkSequence: Streak, Sequnece])
    I0-->J(CheckSequnceWin)
    I0-->|FALSE: IF NOT &&\n ! IFDRAW|I2([checkSequence: Streak, Sequnece])
    J-->|foundWinner|J0(FoundWinnder \n Array.from, every, includes )
    J0-->|True, False|J
    I1-->K1{hasDrawn: TotalTurns}
    I2-->K2{hasDrawn: TotalTurns}
    K1-->|true|K11(Has Draw)
    K1-->|true|K12(Win Outcome)
    K2-->|true|K22(Has Draw)
    K2-->|true|K23(In Play)
    K11-->k3(Outcome)
    K12-->k3(Outcome)
    K22-->k3(Outcome)
    K23-->k3(Outcome)
    k3-->|Game Status \n OUTCOME|I
    I-->H2

Code & Logging: The following are not being reached. in `GameLogic._checkOutcome

// K11
outcome = __logOutcome('5.1.3.1.A1', '🏁🟰', `Game Drawn after maximum turns reached`, this.IFDRAWN);
//K22
outcome = __logOutcome('5.1.3.1.A2', '🏁🟰', `Game Drawn after maximum turns reached`, this.IFDRAWN);

Expected

User Acceptance Criteria is a format to derive consistent expectations

Scenario:

Given: The sequnces for a draw state
(And:) the TotalCount of Turns is greater or equal to 8

When: I click on the 8th or 9th grid cell
(And:): I complete the game

Then: I should declare a draw 
(And:) This should be announce
NOT: declare a Winner or
OR NOT: declare Next Turn

Copy to Readme || Source: []()

Visuals

Add screenshots if needed

Game UI image

Logging in DevTools image

Additional context**

Add any other context about the problem here.