
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
You can create an instance of the object world and with it you can:
cd into your project and execute:
npm i gol-engine
//or with yarn
yarn add gol-engine
This class do all the job: generate days / save history / set patterns
const {world} = require('gol-engine')
const myWorld = new world['default'](5) //The argument is the size on the matrix
| Data: | Desc: |
|---|---|
| map | nxn matrix of 0 or 1 |
| history | list of nxn matrix of 0 or 1 |
| Methods: | Desc: |
|---|---|
| initWorld() | This create the inital matrix (no arguments) |
| displayGrid() | console.log the grid |
| getGrid() | return the map data |
| getNeighbour(posx:number,posy:number) | return the numbers of neighbour |
| nextDay() | generate the next frame and save the previous one in the history |
| generateDays(time:number=10) | execute nextDays() n times. Default value of n=10 |
| bar(x:number,y:number) | Spawn a bar of 3 cells at (x,y) |
| block(x:number,y:number) | Spawn a block of 2x2 cells at (x,y) |
| frog(x:number,y:number) | Spawn a frog @(x,y) |
| barFive(x:number,y:number) | Spawn a bar of five cells at (x,y) |
| glider(x:number,y:number) | Spawn a Glider at (x,y) |
| uClown(x:number,y:number) | Spawn a Clown at (x,y) |
Here is the instruction for basic usage:
npm i gol-engine
//or with yarn
yarn add gol-engine
const {world} = require('gol-engine')
// in your favorite framework:
// import {world} from 'gol-engine'
const myWorld = new world['default'](5)
console.log('INIT..')
myWorld.initWorld()
console.log('### INITIAL MAP ###')
console.log(myWorld.map)
console.log('SET BAR @(2,2)...')
myWorld.bar(2,2)
console.log('### MAP WITH BAR ###')
console.log(myWorld.map)
console.log('GENRERATING NEXT FRAME...')
myWorld.nextDay()
console.log('### FINAL MAP ###')
console.log(myWorld.map)
node ./gol.js
Remenber to init() before using the object "world".
Npm module made from scratch by me, for you, with <3. I used this code to do this in Vue.js with the TS template.
|
Hey there ! I'm always ready to help ! Email me |
FAQs
Game Of Life in typescript
We found that gol-engine 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.