

Racket Gin Rummy in ClojureScript
source link: https://thegeez.net/2012/03/20/racket_gin_clojurescript.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Racket Gin Rummy in ClojureScript
20 Mar 2012A ClojureScript implementation of a simple card game. The game can be played here.
The Racket programming environment comes with a couple of example games written in Scheme. My favorite of these games is Gin Rummy. The object of this game is to make a hand of 10 cards, consisting of a set of four cards and two sets of three cards. A set of cards are cards of the same rank (i.e. three Jacks) or subsequent cards of the same suit (i.e. 8,9,10,J of hearts). An ace can be low or high. The game has two players with ten cards each. In the middle are the deck of cards faced down and a discard pile, with cards face up. Players take turns and can choose to pick to top card of the discard pile or a face down card from the deck. The chosen card has to be exchanged for a card in the players hand, which is placed on top of the discard pile. For more information see the Racket documentation.
cljs-gin is an implementation of Gin Rummy in ClojureScript. The games runs completely in the browser. The Clojure code for the opponent is from a program that takes control of the mouse to play the game against the original Scheme client. This code worked without change in ClojureScript, but its naive algorithm from the Scheme source has been optimized for speed in the browser. The cards are draggable div elements, using the Dragger class from the google closure library.
The game is hosted on Amazon S3: Gin Rummy
The development version has a view of the table state, including the cards of the opponent. This is a consequence of the whole application living at the client. However the code is written to support communication with a server for a remote opponent in the future.
The code is on Github.
Recommend
-
72
使用 ClojureScript 开发浏览器插件的过程与收获2017-11-22编程语言约 4228 字 预计阅读 9 分钟
-
73
For the past few years, I’ve kept a Notes.app list of restaurants, hikes, bars, and other things I’ve been meaning to visit. It was m...
-
52
glue Trying to glue cljs and vue together. Overview So far main idea is just to configure components via clojurescript. Demo Check out
-
8
Gin Rummy with Datomic12 Jun 2014 When I began to learn Clojure I found the Gin Rummy game in the PLT Racket/Scheme program...
-
14
Playing "Racket Gin Rummy in ClojureScript" with Clojure01 Jun 2012 In 2010 I built my first real Clojure application. It was a tool to execute semantic specifications of modeling languages and was part of my master thesis....
-
10
Racket Gin Rummy in ClojureScript20 Mar 2012 A ClojureScript implementation of a simple card game. The game can be played here. The Racket programming env...
-
9
Playing "Racket Gin Rummy in ClojureScript" with Clojure01 Jun 2012 In 2010 I built my first real Clojure application. It was a tool to execute semantic specifications of modeling languages and was part of my master thesis....
-
12
Gin Rummy with Datomic12 Jun 2014 When I began to learn Clojure I found the Gin Rummy game in the PLT Racket/Scheme program...
-
16
Hello everyone, today I will show you how to generate unlimited Coins in Gin Rummy Plus Hack app using your iOS or Android device. This is the only Gin Rummy Plus Mod APK and that works great. So if you want to hack Gin Rummy Plus free Coins the...
-
8
With the increasing popularity of mobile gaming and the widespread accessibility of smartphones, there is a vast potential audience waiting to be captivated by a well-designed rummy game. By seizing this opportunity by developing a rummy game wi...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK