Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create README.md, create games folders automatically, update link to FEN code and all links to https #18

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# PlainChess
PlainChess aims to be a simple yet full–featured and beautiful alternative to the cluttered chess portals currently existing.

## Table of contents
* [What is PlainChess?](#what-is-plainchess)
* [Why yet another chess implementation, what makes PlainChess different?](#why-yet-another-chess-implementation--what-makes-plainchess-different)
* [I want a list, what features do you offer?](#i-want-a-list--what-features-do-you-offer)
* [Which chess rules exactly are implemented, which aren't?](#which-chess-rules-exactly-are-implemented--which-aren-t)
* [I like PlainChess. How can I support you?](#i-like-plainchess-how-can-i-support-you)
* [What features could be implemented next?](#what-features-could-be-implemented-next)
* [General](#general)
* [Online mode](#online-mode)
* [You keep mentioning modern web technologies: What exactly are you talking about?](#you-keep-mentioning-modern-web-technologies--what-exactly-are-you-talking-about)
* [Who are you and why did you make this?](#who-are-you-and-why-did-you-make-this)

## What is PlainChess?
Its primary goal is to allow two persons to play a round of chess, no matter whether they happen to be at the same location or on a different continent.
It's designed to be platform independent and to run on every computer or smart phone equipped with a modern web browser and thus enabling people everywhere around the globe to play chess, at home and on the go, online and offline.
It was originally published in January 2011 and as of March 2013 its [code](https://GitHub.com/TimWoelfle/PlainChess) is open source and licensed under the [GPL Version 3 license](https://www.gnu.org/licenses/gpl-3.0.txt).

## Why yet another chess implementation, what makes PlainChess different?
Its minimalistic approach sets it apart from most of the other chess implementations on the internet.
They usually use browser plugins like Adobe Flash or even client software to realize the game itself and offer a variety of features around it: news, riddles, communities and dozens of little gadgets.
Due to this complexity they often take a lot of clicks to get a game started, they tend to react slowly and are often cluttered with ads.
Some even require registration fees in order to be able to play a game.
PlainChess is free, fast and built on modern web technologies but on the other hand also passes on features beyond basic gameplay.

## I want a list, what features do you offer?
* Online and offline games with an appointed partner
* Nearly full implementation of all official chess rules
* Autosaving the game for interrupted sessions
* Minimalistic and clean interface
* Platform independent due to the use of modern web technologies
* Free and ad–free


## Which chess rules exactly are implemented, which aren't?
Nearly all of them: PlainChess recognizes valid moves as well as [check](https://en.wikipedia.org/wiki/Check_(chess)), [mate](https://en.wikipedia.org/wiki/Checkmate) and [stalemate](https://en.wikipedia.org/wiki/Stalemate) situations.
It also supports the three specials moves of kings and pawns: [castling](https://en.wikipedia.org/wiki/Castling), [pawn promotions](https://en.wikipedia.org/wiki/Promotion_(chess)) and [en passant capturing](https://en.wikipedia.org/wiki/En_passant).
The only rules currently not supported are the draw rules except for stalemate: [threefold repetition](https://en.wikipedia.org/wiki/Threefold_repetition), [the fifty–move rule](https://en.wikipedia.org/wiki/Fifty-move_rule), impossibility of checkmate and [mutual agreement](https://en.wikipedia.org/wiki/Draw_by_agreement).

## I like PlainChess. How can I support you?
Spread the word, tell your friends and enemies about PlainChess; twitter, blog or write letters about it.
Share it on your social networks.
Send me an e-mail. Have a look at [the code](https://GitHub.com/TimWoelfle/PlainChess) and add new features.

## What features could be implemented next?
### General
* Support of time control and chess clocks
* Support of [FEN codes](https://en.wikipedia.org/wiki/Forsyth–Edwards_Notation) and saved games
* Support of at least some of the draw rules
* Optimized layout for smart phones


### Online mode
* Synchronized game time for time control and chess clocks
* Server side turn saving for rejoins and spectator mode
* Player pings for recognition of disconnection


## You keep mentioning modern web technologies: What exactly are you talking about?
PlainChess is the first chess implementation built completely with HTML5 technologies (at least as far as I know).
The game engine is written in JavaScript and relies on the frameworks [jQuery](https://jquery.com) and [jQuery UI](https://jqueryui.com), which means that offline games can be played without internet connectivity (this would be interesting for a smart phone optimized version with [HTML5 manifest](https://www.w3.org/TR/html5/offline.html)).
The design uses CSS3 en masse: rounded borders, shadows, opacity, sprite images and transitions & transforms.

## Who are you and why did you make this?
I'm Tim Wölfle from Germany and wanted to try out the new possibilities HTML5 technologies offer.
At the same time I wanted to play a quick round of chess with a friend on the internet, but didn't find anything that would allow me to start right away and without registration.
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="css/reset.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/default.css" />
<link rel="canonical" href="http://plainchess.timwoelfle.de" />
<link rel="canonical" href="https://plainchess.timwoelfle.de" />
<title>PlainChess</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>
<body>
<div id="header">
<a href="#" id="toggleFaq">Frequently Asked Questions</a> · <a href="https://GitHub.com/TimWoelfle/PlainChess">Code on GitHub</a> · <a href="http://timwoelfle.de">Other projects</a> · <a href="https://twitter.com/timwoelfle">Twitter</a> · <a href="#" id="contact" style="display: inline-block;">E-Mail</a>
<a href="#" id="toggleFaq">Frequently Asked Questions</a> · <a href="https://GitHub.com/TimWoelfle/PlainChess">Code on GitHub</a> · <a href="https://timwoelfle.de">Other projects</a> · <a href="https://twitter.com/timwoelfle">Twitter</a> · <a href="#" id="contact" style="display: inline-block;">E-Mail</a>
</div>

<div id="main">
<h1>
<a href="index.html"><span class="light">Plain</span>Chess</a>
</h1>

<div id="flip">
<div id="faq">
<div id="wideBorder"></div>
Expand All @@ -28,7 +28,7 @@ <h1>
<h2>What is PlainChess?</h2>
<p>PlainChess aims to be a simple yet full–featured and beautiful alternative to the cluttered chess portals currently existing.</p>
<p>Its primary goal is to allow two persons to play a round of chess, no matter whether they happen to be at the same location or on a different continent. It's designed to be platform independent and to run on every computer or smart phone equipped with a modern web browser and thus enabling people everywhere around the globe to play chess, at home and on the go, online and offline.</p>
<p>It was originally published in January 2011 and as of March 2013 its <a href="https://GitHub.com/TimWoelfle/PlainChess">code</a> is open source and licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0.txt">GPL Version 3 license</a>.</p>
<p>It was originally published in January 2011 and as of March 2013 its <a href="https://GitHub.com/TimWoelfle/PlainChess">code</a> is open source and licensed under the <a href="https://www.gnu.org/licenses/gpl-3.0.txt">GPL Version 3 license</a>.</p>

<!--<h2>What is the 'awareness mode'?</h2>
<p>When playing, you can se a little light bulb (<span style="opacity:0.3">💡</span>) on the bottom left, allowing you to switch on 'awareness mode'. This special mode colorizes the fields depending on which player has more pieces that can access it: Green means that white has more control over a field and red means black. Blue means both players have an equal number of pieces that can possibly strike on it. The richer and darker the color, the more pieces have access.</p>
Expand All @@ -50,16 +50,16 @@ <h2>I want a list, what features do you offer?</h2>
</ul>

<h2>Which chess rules exactly are implemented, which aren't?</h2>
<p>Nearly all of them: PlainChess recognizes valid moves as well as <a href="http://en.wikipedia.org/wiki/Check_(chess)">check</a>, <a href="http://en.wikipedia.org/wiki/Checkmate">mate</a> and <a href="http://en.wikipedia.org/wiki/Stalemate">stalemate</a> situations. It also supports the three specials moves of kings and pawns: <a href="http://en.wikipedia.org/wiki/Castling">castling</a>, <a href="http://en.wikipedia.org/wiki/Promotion_(chess)">pawn promotions</a> and <a href="http://en.wikipedia.org/wiki/En_passant">en passant capturing</a>. The only rules currently not supported are the draw rules except for stalemate: <a href="http://en.wikipedia.org/wiki/Threefold_repetition">threefold repetition</a>, <a href="http://en.wikipedia.org/wiki/Fifty-move_rule">the fifty–move rule</a>, impossibility of checkmate and <a href="http://en.wikipedia.org/wiki/Draw_by_agreement">mutual agreement</a>.</p>
<p>Nearly all of them: PlainChess recognizes valid moves as well as <a href="https://en.wikipedia.org/wiki/Check_(chess)">check</a>, <a href="https://en.wikipedia.org/wiki/Checkmate">mate</a> and <a href="https://en.wikipedia.org/wiki/Stalemate">stalemate</a> situations. It also supports the three specials moves of kings and pawns: <a href="https://en.wikipedia.org/wiki/Castling">castling</a>, <a href="https://en.wikipedia.org/wiki/Promotion_(chess)">pawn promotions</a> and <a href="https://en.wikipedia.org/wiki/En_passant">en passant capturing</a>. The only rules currently not supported are the draw rules except for stalemate: <a href="https://en.wikipedia.org/wiki/Threefold_repetition">threefold repetition</a>, <a href="https://en.wikipedia.org/wiki/Fifty-move_rule">the fifty–move rule</a>, impossibility of checkmate and <a href="https://en.wikipedia.org/wiki/Draw_by_agreement">mutual agreement</a>.</p>

<h2>I like PlainChess. How can I support you?</h2>
<p>Spread the word, tell your friends and enemies about PlainChess; twitter, blog or write letters about it. Share it on your social networks. Send me an e-mail. Have a look at <a href="https://GitHub.com/TimWoelfle/PlainChess">the code</a> and add new features.</p>

<h2>What features could be implemented next?</h2>
<h3>General</h3>
<ul>
<li>Support of time control and chess clocks</li>
<li>Support of <a href="http://en.wikipedia.org/wiki/FEN">FEN codes</a> and saved games</li>
<li>Support of <a href="https://en.wikipedia.org/wiki/Forsyth–Edwards_Notation">FEN codes</a> and saved games</li>
<li>Support of at least some of the draw rules</li>
<li>Optimized layout for smart phones</li>
</ul>
Expand All @@ -73,7 +73,7 @@ <h3>Online mode</h3>

<h2>You keep mentioning modern web technologies: What exactly are you talking about?</h2>
<p>PlainChess is the first chess implementation built completely with HTML5 technologies (at least as far as I know).</p>
<p>The game engine is written in JavaScript and relies on the frameworks <a href="http://jquery.com/">jQuery</a> and <a href="http://jqueryui.com/">jQuery UI</a>, which means that offline games can be played without internet connectivity (this would be interesting for a smart phone optimized version with <a href="http://www.w3.org/TR/html5/offline.html">HTML5 manifest</a>).</p>
<p>The game engine is written in JavaScript and relies on the frameworks <a href="https://jquery.com/">jQuery</a> and <a href="https://jqueryui.com/">jQuery UI</a>, which means that offline games can be played without internet connectivity (this would be interesting for a smart phone optimized version with <a href="https://www.w3.org/TR/html5/offline.html">HTML5 manifest</a>).</p>
<p>The design uses CSS3 en masse: rounded borders, shadows, opacity, sprite images and transitions &amp; transforms.</p>

<h2>Who are you and why did you make this?</h2>
Expand Down Expand Up @@ -169,4 +169,4 @@ <h2><a href="#">Start new game</a></h2>
<script src="js/jquery-ui.min.js"></script>
<script src="js/game.min.js"></script>
</body>
</html>
</html>
3 changes: 2 additions & 1 deletion php/hostGame.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
if (!$gameName = $_POST["id"]) return false;
if (strpos($gameName, "\\") !== false || strpos($gameName, ".") !== false || strpos($gameName, "*") !== false) return false;
mkdir("../games/");
if (!fclose(fopen("../games/".$gameName, "x"))) return false;
echo $gameName;
?>
?>
7 changes: 4 additions & 3 deletions php/makeMove.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if ((!$endRow = $_POST["endRow"]) || intval($endRow) < 1 || intval($endRow) > 8) return false;
if (($promType = $_POST["promotionType"]) && strlen($promType) > 3) return false;
$gameOver = $_POST["gameOver"];

if (!$oldMoves = file_get_contents("../games/".$gameName, 0, NULL, 0, 100000)) return false;
$newMove = $startCol . $startRow . " " . $endCol . $endRow;
if ($promType) {
Expand All @@ -16,8 +16,9 @@
$newMove .= " " . date("d.m.Y H:i:s");
file_put_contents("../games/".$gameName, $newMove . "\n" . $oldMoves);
if ($gameOver) {
mkdir("../games/finished/");
copy("../games/".$gameName, "../games/finished/".$gameName);
}

echo $gameName;
?>
?>