![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
An implementation of the ancient Chinese board board Go (Chinese: wéiqí, Korean: baduk, Japanese: igo)
weiqi.js
is an implementation of the board game Go. It provides
mechanisms for representing a board with black and white stones, as well as the
logic to actually play a game. The objects used in weiqi.js
are
persistent--methods often return entirely new instances instead of
mutating internal state.
Persistence and structural sharing offer a memory-efficient way to represent multiple states of the board simutaneously, a desirable trait for applications where you'd like to explore the history of the game (such as for review) or to explore possible future responses (such as for AI decision-making).
The library is available as an npm
package, and can be used in the
browser with tools like browserify. If you don't want to use browserify,
there is a pre-built file in the dist-browser
directory that you can include
in your browser-targeted projects right away. Access Weiqi
with the global
Weiqi
variable in this case.
var Weiqi = require('weiqi');
var game = Weiqi.createGame(9); // creates a game on a 9 x 9 board
game = Weiqi.createGame(13); // creates a game on a 13 x 13 board
game = Weiqi.createGame(19); // creates a game on a 19 x 19 board
var Weiqi = require('weiqi');
var game = Weiqi.createGame(9);
game = Weiqi.play(game, 'black', [2,2]);
game = Weiqi.play(game, 'white', [6,7]);
game = Weiqi.pass(game, 'black'); // black passes
game = Weiqi.pass(game, 'white'); // white passes
Weiqi.play
and Weiqi.pass
each take a player identifier ('black'
or 'white'
). Weiqi.play
takes an additional zero-indexed array of size two that indicates the position to place a stone. Weiqi.play
will raise exceptions for the following situations:
get('currentPlayer')
returns either 'black'
or 'white'
.
> var Weiqi = require('weiqi');
> var game = Weiqi.play(Weiqi.createGame(9), 'black', [2,2]);
> game.get('currentPlayer');
"o"
isOver
returns true iff there have been two consecutive passes.
> var Weiqi = require('weiqi');
> var game = Weiqi.play(Weiqi.createGame(9), 'black', [2,2]);
> Weiqi.isOver(game);
false
> game = Weiqi.pass(game, 'white');
> Weiqi.isOver(game);
false
> game = Weiqi.pass(game, 'black');
> Weiqi.isOver(game);
true
To compute the score of the game (using area score) pass a value of komi to areaScore()
. All stones are considered alive.
Weiqi.areaScore(game, 7.5); // compute area score given 7.5 komi
FAQs
An implementation of the ancient Chinese board board Go (Chinese: wéiqí, Korean: baduk, Japanese: igo)
The npm package weiqi receives a total of 6 weekly downloads. As such, weiqi popularity was classified as not popular.
We found that weiqi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.