Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snekjs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snekjs

A terminal-based Snake implementation written in JavaScript (Node.js) 🐍

  • 1.0.3
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

🐍 Snek.js License: MIT snekjs on NPM

A terminal-based Snake implementation written in JavaScript (Node.js).

snek.gif

Instructions

Use the arrow keys (, , , ) or W A S D to navigate the snake up, down, left, or right. Eat the red dot to gain points. If the snake collides with the wall or its own tail, it's game over. Press ENTER to restart, and Q, ESCAPE or CTRL + C to quit the game.

Installation

Clone from repository

git clone https://github.com/taniarascia/snek
cd snek
yarn && yarn play

npm module

Add the snekjs module.

yarn add snekjs

Create the game.

// index.js

const blessed = require('blessed')
const { UserInterface, Game } = require('snekjs')
const ui = new UserInterface(blessed, blessed.screen())
const game = new Game(ui)

// Begin game
game.start()

Run the game.

node index.js

Acknowledgements

  • Vanya Sergeev for pointing out my snake collision bug, for advising me to make a single, reusable draw method, for showing me how to properly bind methods between classes, and for overall guidance and inspiration
  • Devin McIntyre for general advice
  • Panayiotis Nicolaou's JavaScript Snake for Web for initial logic

Author

License

This project is open source and available under the MIT License.

Keywords

FAQs

Package last updated on 09 Apr 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc