An interactive Tic Tac Toe game

Overview

This module implements an interactive Tic Tac Toe game

It can present a Tic-Tac-Toe board that is updated using AJAX requests upon each user move.

The module implements the alpha beta search algorithm (Minimax search optimized by performing alpha beta pruning) for determining the next move, which are common algorithms for zero-sum two player games (e.g. Tic Tac Toe and Chess).

Sandbox project page:

http://drupal.org/sandbox/ankitchauhan/1556724

You can clone the repository with the following command:

git clone --recursive --branch 6.x-1.x http://git.drupal.org/sandbox/ankitchauhan/1556724.git tic_tac_toe
cd tic_tac_toe

Dependencies:

Drupal core version 6.x

latest reviewed project
http://drupal.org/node/1578782#comment-5997300

previously reviewed project
http://drupal.org/node/1570606#comment-5979418
http://drupal.org/node/1553456#comment-5983488
http://drupal.org/node/1380540#comment-5983994
http://drupal.org/node/1434388#comment-5954324
http://drupal.org/node/1434388#comment-5963546
http://drupal.org/node/1563728#comment-5964682

CommentFileSizeAuthor
#21 drupalcs-result.txt4.2 KBklausi
Screenshot.png28.37 KBankitchauhan

Comments

patrickd’s picture

welcome,

As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow the tips for a great project page. Also make sure your README.txt follows the guidelines for in-project documentation.

while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxankitchauhan1556724git

We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.

regards

ankitchauhan’s picture

@patrickd

Thanks for your quick response.

I update my application soon after fixing some coding style issue.

Thanks again,

ankit

ankitchauhan’s picture

Issue tags: +PAreview: review bonus

applying for pareview bonus

luxpaparazzi’s picture

Issue tags: -PAreview: review bonus

Posted by patrickd on April 24, 2012 at 10:05pm

Thanks for your participation, but I'm afraid the comments you did are not very detailed and IMHO not really "reviews".
A good deep review can take up to an hour, this is not about just pointing out 2 things and set the issues to needs work.
Sorry, removing tag.
http://drupal.org/node/1540804#comment-5912808

luxpaparazzi’s picture

project page
Please take a moment to make your project page follow tips for a great project page.
luxpaparazzi’s picture

Issue summary: View changes

reviewed project links added

ankitchauhan’s picture

Issue summary: View changes

updating project description

ankitchauhan’s picture

Issue summary: View changes

updating project summery

ankitchauhan’s picture

Issue summary: View changes

updating project summery

ankitchauhan’s picture

Issue tags: +PAreview: review bonus

applying for PAreview Bonus

saltednut’s picture

Regarding the .info file and using 'Games' as the package

Per: Writing .info files (Drupal 6.x)

In general, this field should only be used by large multi-module packages, or by modules meant to extend these packages, such as CCK, Views, E-Commerce, Organic Groups and the like. All other modules should leave this blank. As a guideline, four or more modules that depend on each other (or all on a single module) make a good candidate for a package. Fewer probably do not.

Looks like it would be pretty easy to pass for i18n (per Coder) by updating your JS:

TicTacToe.js
Line 109: Javascript strings should be passed through Drupal.t().
          alert('You Lost');
Line 114: Javascript strings should be passed through Drupal.t().
          alert('You Won');
Line 119: Javascript strings should be passed through Drupal.t().
          alert('The Game is Drawn');
Line 123: Javascript strings should be passed through Drupal.t().
          alert('Unknown status');
scarer’s picture

There's a few of instances of using double quotes when only single quotes are needed for passing string arguments in the PHP. Board.php, GameSearch.php and TicTacToe.php all have some.

The only other concern I have is the namespace issues for the additional files e.g. Board.php, GameSearch.php and TicTacToe.php as well as the Javascript files; it would be good if all these files had the namespace for the module e.g. tic_tac_toe_board.php etc. Also the functions contained in these files should also contain the module namespace. This is just so it's clear that all of these functions, files etc. belong to this module.

I installed the module and it seems to work fine.

Also, you might want to fix up your GIT repo clone instructions at the top of this issue as it doesn't work - this only applies to you. You need to use this instead if you want to review (listed on the version control tab off the sandpit anyway):

git clone --recursive --branch 6.x-1.x http://git.drupal.org/sandbox/ankitchauhan/1556724.git tic_tac_toe
cd tic_tac_toe

There's a number of errors with the js script raphael-min.js showing up in ventral: http://www.ventral.org/pareview/httpgitdrupalorgsandboxankitchauhan15567...

Nice to have

It would be a nice addition to have a button to enable you to clear a game and start a new one (i.e. in the block). Also a score tally would be good.

Cheers

scarer’s picture

Issue summary: View changes

project description updated

ankitchauhan’s picture

thank you guys for you review.

all fixes has been done in #7

working on #8 comments
I've updated files name with namespace tic_tac_toe
updated GIT repo clone instructions as

git clone --recursive --branch 6.x-1.x http://git.drupal.org/sandbox/ankitchauhan/1556724.git tic_tac_toe
cd tic_tac_toe

in issue summery

I'll update raphael-min.js with ventral coding style fixes soon.

thank you guys for your consideration.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732

The file names do only matter for the module file and the info file, all other files do not have to be namespaced.

manual review:

  1. tic-tac-toe-raphael-min.js appears to be 3rd party code. 3rd party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms. The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.
  2. tic_tac_toe_game_action(): You should use drupal_json(), or at least set the correct header if drupal_to_js() does not work for you.
  3. "abstract class GameSearch": all class names should be prefixed with your module name to avoid name collissions. Same for "Board".
  4. tic-tac-toe-block-view.tpl.php: do not embed script stuff into the template. Use drupal_add_js() and Drupal.behaviors to manage your javascript, see http://drupal.org/node/304258
  5. tic-tac-toe-block-view.tpl.php: do not embed style information, use dedicated CSS files and drupal_add_css() instead.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

scarer’s picture

@klausi - oh I didn't know. I thought the namespace thing was real. Silly me. Maybe I dreamt it.

Sorry for the confusion @ankitchauhan. Good luck!

ankitchauhan’s picture

Hi guys

I have done lot of modification in the project and fixing all the style issue.
Added Libraries API module dependency and added instruction in README.txt

When I apply step 5 in http://drupal.org/node/1127732 to delete README.txt in the master branch
get error as

remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error:
remote: error: You can set 'receive.denyDeleteCurrent' configuration variable to
remote: error: 'warn' or 'ignore' in the remote repository to allow deleting the
remote: error: current branch, with or without a warning message.
remote: error:
remote: error: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master
To ankitchauhan@git.drupal.org:sandbox/ankitchauhan/1556724.git
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'ankitchauhan@git.drupal.org:sandbox/ankitchauhan/1556724.git'

please guide me what to do?

saltednut’s picture

I was looking for official documentation about README.txt being the only file that should be in the MASTER branch but I can't find it.

There are still files other than README.txt in the master branch...

http://drupal.org/node/1556812#comment-5971306

You can keep the master branch with only README.txt in it.

Also see: http://drupal.org/node/1074960

ankitchauhan’s picture

hi guys

I've cleared the MASTER branch

ankitchauhan’s picture

Issue summary: View changes

project description updated

ankitchauhan’s picture

Status: Needs work » Needs review
klausi’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: http://drupal.org/node/1556812
Project 2: http://drupal.org/node/1539536

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

ankitchauhan’s picture

Status: Closed (duplicate) » Needs review

Hi klausi

I forgot this guideline. My apologies.

Actually, I just get an idea and implemented it.

ankitchauhan’s picture

Issue summary: View changes

project description updated

ankitchauhan’s picture

Issue tags: +PAreview: review bonus

applying for pareview

patrickd’s picture

Issue tags: -PAreview: review bonus

I'm afraid I've to remove that tag because 2 of your reviews are not really manual as required for review bonus, they are just pointing out issues that are / can be found by automated tools. Sorry.

patrickd’s picture

Issue summary: View changes

project description updated

ankitchauhan’s picture

Priority: Normal » Major

need review

klausi’s picture

Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.2 KB

Sorry for the delay. Make sure to review more project applications and get a new review bonus to get this finished faster.

Review of the 6.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. tic-tac-toe-start.js: should use Drupal.behaviors, see http://drupal.org/node/304258
  2. tic_tac_toe_admin_settings(): your module defines its own variables, so you should remove them in hook_uninstall().

Although you should fix those issues they are no blockers, so I think this is RTBC.

ankitchauhan’s picture

Hi klausi

thanks for coming back for the review. I have made the changes and committed the code.

sreynen’s picture

Status: Reviewed & tested by the community » Fixed

Hi ankitchauhan,

Thanks for your contribution and welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects, at your discretion.

Now that you've experienced the full review process, please consider reviewing other projects that are still awaiting review. Anyone can help with reviews, following the guidelines.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

orther project revied links added

avpaderno’s picture

Title: Tic Tac Toe » [D6] Tic Tac Toe