yarcat / chemistry-lines

Chemistry Lines (game)
1 stars 0 forks source link

In case of `I` `Br` `I` only one `IBr` is getting removed. #42

Closed soulne4ny closed 12 years ago

soulne4ny commented 12 years ago

At least in compact-formulas #10.

soulne4ny commented 12 years ago

The same with S Ba F2 in #10. Only BaS is removed however BaF2 is also possible. Only one compound is removed from N2 O3 N2 as well as O3 N2 O3. And H2 O H2.

soulne4ny commented 12 years ago

Tried to reproduce. Added H Cl H test to FormulaRegistryTest.

    @Test
    public void testHClH() {
        assertTrue(reactionProduces("HCl", "H", "Cl"));
        assertTrue(formulaIsRemoved("H", "Cl"));
        assertTrue(formulaIsRemoved("Cl", "H"));
        assertTrue(formulaIsRemoved("H", "Cl", "H"));
        assertTrue(formulaIsRemoved("Cl", "H", "Cl"));
    }

It is passing. Similar tests with other elements are passing also.

yarcat commented 12 years ago

Luch, please close the bug after "game-log" is in "master".

yarcat commented 12 years ago

It still behaves weirdly. This is what log shows when I try to remove Co, O, 2

 - O
 - O2
 - O
 - CoO

Though it should be something like

- O  // In case just pure O could be removed!
- O2
- CoO
yarcat commented 12 years ago

Hmm... Can it be so that O is removed vertically and horizontally? We shouldn't allow removing single O. It's kinda stupid and looks like a bug on wikipedia.