Database Chess A server-based web gaming application by Jordan Arnold.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Consignment Tracking System An Overview - Aron Bury - Ian Searle - Ian Storey.
Place captured red pieces below Place captured blue pieces below Rules New Game Exit Left mouse click on piece – drag to desired location - left mouse.
Table of Contents Why Play Chess? Setting Up the Board Get to Know the Pieces Check and Checkmate What the Chess Pieces Are Worth Opening Goals Endgame.
CHESS FOR KIDS Lesson 1.
L.O. Today you will learn how to play chess. How to Play Chess.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Basic concept Technologies we have used The Design Problems, challenges & solutions Educational Gain.
Dynamic Web Pages. Web Programming  All our web pages so far have been static pages. 1. We create a web page 2. We upload it to the web server 3. People.
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
Multiple Tiers in Action
RULES Each player begins the game with twelve normal pieces (either white or black). The pieces are automatically set in their proper positions. The object.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Chapter 14 Introduction to HTML
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Application for Internet Radio Directory 19/06/2012 Industrial Project (234313) Kickoff Meeting Supervisors : Oren Somekh, Nadav Golbandi Students : Moran.
Web Design Basic Concepts.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Chess Merit Badge Chess Basics: Set Up the Board & Basic Rules by Joseph L. Bell © 2011.
Introduction to AJAX AJAX Keywords: JavaScript and XML
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
AJAX Chat Analysis and Design Rui Zhao CS SPG UCCS.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
PHP. Why should we learn web programming? No need write socket programming. - You can forget TCP/IP & OSI layers. - Web server handles socket tasks for.
Server-side Scripting Powering the webs favourite services.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
PHP meets MySQL.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
The Document Object Model. The Web B.D, A.D. They aren’t web pages, they’re document objects A web browser interprets structured information. A server.
JavaScript – Quiz #9 Lecture Code:
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Website Development with PHP and MySQL Saving Data.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
ProjectManager Plugin. Objective Enable web-based storage for construals – Save construals without having to copy script generator text to notepad – Load.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
How to Play Chess. Name of Each Piece The relative values of the chess pieces 9 points 5 points 3+ points 3 points 1 point.
Chess By Kezia Farley.
Summary of the Moves of Chess
A game based off of the esteemed classic By: Tadziu Kosiara.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
The Basics Of Chess Student Name: Jovannie Charles Date: 3/25/11.
Microsoft Access 2000 Creating Queries, Reports and Web Pages.
The basics of knowing the difference CLIENT VS. SERVER.
Discussion 2: Intro to Project 1: Chess Submit Project 1 under # 11!
Copyright © 2002 Pearson Education, Inc. Slide 3-1 Internet II A consortium of more than 180 universities, government agencies, and private businesses.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
Higher Computing Science Coding the Web: HTML, JavaScript, PHP and MySQL.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Display Page (HTML/CSS)
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
1/7/2016www.infocampus.co.in1. 1/7/2016www.infocampus.co.in2 Web Development training gives you and all-round training in both the design and the development.
CHESS “The Ultimate GAME of Challenge and Strategy”
JavaScript and Ajax (Ajax Tutorial)
Ab & Team Presents CHESS “It’s not just a game”.
CHESS PIECES.
How To Play Chess (And other Information)
CHESS.
Web Systems Development (CSC-215)
Chapter 27 WWW and HTTP.
Rules to play chess. Chess is a played with 16 pieces: 8 pawns, 2 towers, 2 knights, 2 bishops, 1 queen and 1 king. Movements: Pawns: They only can move.
Presentation transcript:

Database Chess A server-based web gaming application by Jordan Arnold

Objectives To create a web-based game that can be played by two people across great distances Have a user interface for said game that is simple and intuitive, not requiring knowledge of web languages To do so using only languages and techniques learned in this course

Implementation I: Data Storage The information required to generate a chess game (the positions of all 32 pieces) is stored in a table on a MySql database. Positions are stored as integers, according to the grid shown, with the vertical as the 10's place and the horizontal as the 1's.

Implementation II: Interface The game board is displayed via a dynamically- created XHTML page, which is done in JavaScript. Each square on this grid is actually a transparent png image of a fixed size. Given the numbered positions of the pieces, this page displays corresponding images in the correct locations. Performing a move is done by simply clicking the desired piece and then its target square. Illegal moves are detected by the submission function, inside this code.

Implementation III: Data Retrieval The information stored on the MySql database is retrieved using a PHP file. Since the interface is done in Javascript, a method of sending information between the two was needed. The solution is to include the PHP code as an “external script”, as shown: This PHP file will dynamically create a Javascript code using “print()” statements. The interface page will then receive this script, which contains all the needed variable values

Implementation IV: Data Submission Updating the database requires sending data in the reverse direction, from Javascript to PHP. This is done using an XML HTTP Request. The relevant code is shown: xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","submitMove.php?piece=" + selectedPiece.id +"&moveTo=" + moveTo.id,true); The two variables, representing which piece was moved and where it was moved to, are added to the data stream after the file name. This information is retrieved in the PHP file via $_GET.

Game Rules The rules of the game are enforced by the client-side application, which will not allow an illegal move to be submitted to the server. This is done by checking the numbered indexes against the type of piece. For example, a Bishop can only move diagonally. The bishop is marked “B”, and its legal target squares are marked “T”. The Bishop is on square 74. All of its legal targets obey one of the following equations: (74 – T) % 9 == 0 or (74 – T) % 11 == 0

Game Rules II: In addition to the rules governing each specific piece, the following were also enforced: No piece may capture another piece of the same color. A blank square may not be selected first (it is impossible to move an empty square) No square may be selected twice (a piece may not “move” to its current square) Black pieces may not be moved on White's turn, and vice versa.

Future Improvements: While impressive, this game could benefit from several additional features, which I intend to implement in the future for my own benefit. These include: More complicated rules of Chess (castling, En Passant, promotions, etc.) Chat feature to allow opponents to communicate. User-accessible record of the game in chess notation.