Giter Site home page Giter Site logo

tictac2's People

Contributors

bbuecherl avatar benjaminaaron avatar tuttirh avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

benjaminaaron

tictac2's Issues

PauseActivity

I would like to remove the PauseActivity (currently not implemented) and use alert dialogs instead, they would show up, when playing and pressing back or home buttons.
They would ask the user to either perform the action, or return back to the game.

Recreate GUI Navigation

Current navigation is crashing very often, lacking responsibility and should be more bidirectional, this has to be changed fast.

bug on last field

I discovered a bug in the game model, thats telling me game is over, but i could win with my last mark.
screenshot_2013-11-25-14-03-57

Reproduce: me (blue) starts playing, bot (green) is always second. Play like:
1 2 2
0 0 1
1 0 2
then set last row and mid for:
1 2 2
0 0 1
1 1 2
(hope that) the bot will take mid point:
1 2 2
0 2 1
1 1 2
now i receive getGameRunning() as false, no winner and game is finished.
but me (blue) could win.

Sound

Ok, in our backlog, we included a sound feature, its already added to options (sound on/off). My issue is, what sounds do you want to use and on what actions?

  • Sound on click?
  • Sound on win?
  • Sound on lose?
  • Backgound music?

Or do you want to add more/less ? @TuttiRH @gherndl @benjaminaaron

Game parameters bug

while working on my smartBotV2[#17] i've encountered a bug within our game parameters.
Try to play a 4x4/5x5/6x6 with win length 3..., if both players play intelligent, the starting one will always win:

0 0 0 0
0 1 2 0
0 0 0 0
0 0 0 0 

=>

0 0 0 0
0 1 2 0
0 1 0 0
0 2 0 0 

=>

0 1 0 0
0 1 2 0
0 1 0 0
0 2 0 0 

=> we have to think about the parameter logic once more

change winCheck logic in BoardManager

While the tube & wanderField concept is nice I think it would be more elegant to equip each field with the ability to check if it has the same value as one of its neighbors and thus decentralize the winChecking to a deeper level into the architecture (encapsulation).
This might also come I handy for other types of bot intelligence then brute force over all possible moves. An array of "islands" (like chains of 2 or 3 where winLength is 4) for instance that the bot might choose to build out further.

Change Board-logic

From self-building fields to the Integer-array representation already in use in the two smartBots -> much less code and more performant.
Requires #22 to be fixed.

Realign Layouts

I will add some device dependent responive layout for version 2.0.

create smartBot

A simple version of smartBot has to work for the first release...

smartBot V2

First of all, i thought about how i play TicTacToe.
On a 3x3 I will either start on center or on one of the edges. Why? Because they have the highest possibility of a win arrays...
I do this by counting all possible win arrays of an field:

3 2 3
2 4 2
3 2 3

This start "decision" grid (i will call them "predecision" grids later on) is depending on board size and win length (not on marks per turn).
With our features (Size 3x3-6x6, win length 3-6) we result in 10 predecision grids.
They can be easily stored in the code.

1.

If its the smart bots (1) (furthur refered to as [1]) starts, he will simply set his mark on the "highest" value of the predecision grid.

0 0 0 
0 1 0
0 0 0

2.

Now its the other (in my example a human (2) furthur refered to as [2]) players turn: Let me just start like this:

0 0 0
2 1 0
0 0 0

3.

Now the [1] has to recalculate his decision grid. for this second turn, he will simply modify the predecision grid:

3 2 3    4 2 3
2 4 2 => 0 4 1
3 2 3    4 2 3

The grid is changed by these rules:
a. The fields he already marked won't change.
b. The fields the other player marked this round will be set to 0
c. All values of fields affected (inside win array) by the fields marked this round by the other player will increment by 1. (Except it is blocked like in d.)
d. All values of fields affected by two fields marked (one of them this round) by the other player are doubled (e.g. marked Field[1][0],Field[0][2] -> affected: Field[1][2]) Except one of the bots marks already blocks one of the other ones marks (in the example: Bot has a mark at Field[1][1] blocking Field[1][0] from Field[1][2])
e. All values of fields affected directly by fields marked (one of them this round) by the other player will be set to 1000 (e.g. marked 2 2 0 in one row/column/diag)
f. All values of fields affected by two fields marked by the bot (one of them this round) will be tribbled. Except one ot the other players marks block one of the marks (like d.)
g. All values of fields affected directly by fields marked (one of them this round) by the bot will be set to 2000 (like e.)
h. The fields that lost a win length, by beeing blocked by [1] and [2] (in our example this is Field[1][2].

4.

Now [1] will choose the field with the highest value again, if there are more than one possibilities, he will randomly deside.

0 0 0
2 1 0
1 0 0

5.

[2]'s turn, he realises that he will lose, so he blocks:

0 0 2
2 1 0
1 0 0

6.

[1] will refactor the decisiongrid again:

4 2 3    5 3 0
0 4 1 => 0 4 2
4 2 3    4 2 7

now he decides and marks again:

0 0 2
2 1 0
1 0 1

7.

[2] realises that he has lost, he blocks the most obvious:

0 0 2
2 1 0
1 2 1

8.

[1] recalculates the decision tree:

5 3 0    2000 2 0
0 4 2 =>    0 4 2
4 2 7       4 0 7

and marks:

1 0 2
2 1 0
1 2 1

SmartBot won.

Conclusion

I hope i did not make a mistake anywhere in the examples.
Feedback appreciated. (Especially for the rules)
I already created the predicision trees.

Replace System.outs with return statements in model-package

Would be nice to remove the System.out.println statement (will only show up on the debug console in eclipse) and replace them with either enums, integer or boolean return values. Furthermore we could use Exceptions for error handling.

Sadly smartBotV1 unplayable in 4x4 and above

Android will shut down the process, because it takes to long to calculate, this could be solved by threading it inside async tasks, but we will not fix this till our release tonight..

GUI

Includes #3 and #4. Plus splashScreen and look & feel of all screens.

quick mode

Adding feature of quick mode - when player doesn't place his mark within a given time his mark will be placed randomly.
@bbuecherl can you add a checkbox for that in the options and a slider for the time interval in the menu where also sound/vibration is?

Replay & Share Feature

i would like to implement a gif generator, which is recording every step in the game, and which will be saved at the end of the game. Now you can either save &share it right from the "game over"-alert, save it, or if he dismisses, it will be deleted.
It will saved to the external storage of his device.
I will add a "Replay" Button to the MenuActivity, where all his saved replays are listed. He will be able to review them and share them (again).

Removing GameInterface

I think we can remove GameInterface, because the views & controllers only use the direct Game object reference.

Documentation

We have to add java docs to every method/class/constructor and generate a doc folder for simpler reference

Adding MarkCreator

I'm thinking about adding an interface for creating custom marks, which enables player to draw rectangles, lines and circles in different colors and use them for playing, they will be stored as JSONArrays locally and will be used online by automatically sending this code over network.
Maybe i will add customize options for GUI elements too.

bug in BoardParser

int[] testBoardArr = {1,2,0,1,0,0,1,2,0,1,2,3,0,0,2,0};
System.out.println(BoardParser.testBoardForWinner(testBoardArr, 4, 4));

Returns 1 as winner, even so 1 has only three in a chain yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.