npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aart-blackjack

v0.3.13-beta

Published

blackjack terminal user interface

Downloads

5

Readme

Blackjack (Not the casino game 21)

Blackjack is an incredibly fun game which you can play with two to seven players. We do not mean the famous casino banking game which is also often called 21. The Blackjack we mean is similar to what is referred to as English Blackjack, but the rules have been written based on how I remember playing from childhood with family and friends. The objective of the game is to be the first player among multiple opponents to empty their hand. Players may also immediately spot that the gameplay is almost identical to Uno, the famous game invented around 1971. Both Uno and English blackjack are probably derived from Crazy eights or formerly Eights which appeared around the 1930s. What makes Blackjack an exciting game is that it relies on both skill and chance, and it is a volatile game where circumstances can change in a mere few turns.

There are many tactics one can use to improve their likelihood of winning the game, however, chance has a large share of say in the outcome, meaning first timers can often beat experienced players. Games often occur where you are holding 20 cards with no hope of winning in sight, and then the right card enters into play and allows you to chain an avalanche of cards, taking you to the top of the race to finish. Or there are games where you have one card left, with victory in sight, and your opponent flanks you with a stacked 2, or a blackjack. Or there even are times where you are in a standoff, neck and neck with one or more opponents, both with only a single card left. There are games where your opponent has been playing conservatively, seemingly uninteresting and far from winning, unbeknownst to you they are holding both blackjacks, or perhaps some 2s, or they could be holding onto a fatal chain of winning cards, waiting for the right moment.

Requirements

Stable version of NodeJs ( with Node Package Manager):

recommended version 18.15.0 or any higher LTS version https://nodejs.org/en

A Secret Network testnet account and mnemonic.

You can easily setup a secret network testnet address using keplr: https://keplr.crunch.help/en/getting-started/installing-keplr-wallet

If you already use keplr, it is strongly recommended that you create a new, separate account from your primary one anyway:

Open the keplr app and select 'add account' in the top right corner, then choose 'create new account' to generate a different mnemonic, set account name such as 'blackjack-account' so you know it is not your primary one . In short, do not supply your primary account's mnemonic phrase even if only using the testnet.

Keep a note of your game account's 12 / 24 word mnemonic phrase.

Once setup, make sure keplr is using your game account and connect to the SecretNetwork testnet using this link: https://connect.pulsar.scrttestnet.com/

Use a testnet faucet, add scrt tokens to your testnet address: https://faucet.pulsar.scrttestnet.com

app installation via npm:

To make the app available in your terminal, make sure to include the '-g' flag when using npm as follows:

npm i -g aart-blackjack

Startup:

To start the app in a terminal session, run

aart-blackjack

in Linux and macOS, or

aart-blackjack.cmd

in windows command-line or powershell.

setting up your app

Note: to open the settings menu any time, press 'shift' and '+' key together (if a prompt input is active, press 'shift' and '+', then hit 'enter' ). To exit the application, press escape key or Ctrl-C.

When you startup for the first time, you will be alerted that you need to set your wallet using your mnemonic phrase. your mnemonic phrase is used by secretjs, a trusted JavaScript SDK to connect to the network and interact with the smart contract. The phrase is stored locally in a text file on your device's home directory in the hidden folder {your home dir}/.aart/blackjack/.env.

After pressing enter to close the alert, you will be taken to the settings menu, where you can choose the 'set wallet' option by entering 5. A prompt will allow you to enter your phrase separated by spaces. (click the middle mouse button / scroll wheel to paste from clipboard, or enter manually).

Alternatively you can directly add your mnemonic phrase to the dotenv file located in your home directory.

e.g. ~/.aart/blackjack/.env, by adding the line:

MNEMONIC='<your mnemonic phrase here>'

Make sure that the phrase is correctly typed/pasted, is inside single quotation marks, and entered on a single line. Also make sure you do not change anything else in this file.

Next you will be alerted that you need to set a viewing key, and then taken to the settings menu.

A viewing key is used to make private queries on the secret network, this allows you to view your cards while preventing other players from being able to see them on the blockchain. The viewing key is stored inside the dotenv file. If you use another device later, you will have to either copy over this viewing key, or set a new viewing key, overwriting the old one.

Select 'generate viewing key' in the settings menu by entering index 0. If you get an error, check your network connection, and that your mnemonic phrase is correct.

You may now quit the settings menu by entering 'q'. You will then be taken to the dashboard.

Using the user friendly UI, you can join public games, play privately with friends and compete in weekly tournaments, winning prizes. For more info on how to use the terminal UI, including how to play blackjack, view the google doc:

https://docs.google.com/document/d/1gZKyhDEt9Bb7p6Lb5xmXUYwJGdQrV5BWb592vgdoERI/edit?usp=sharing

beta-testers welcome

This application is in beta and currently testnet only, expect some strange behaviour from time to time, over the course of its development gameplay and UI may change. If something's is broken, usually restarting the app, or selecting a different endpoint in the settings menu will make it go away, but please tell us about any persistent errors, and we may be able to help you.

updates

You can easily update you app by rerunning npm i -g aart-blackjack. Your account / settings will be saved, and you will only need to regenerate your viewing key per update. There is currently no support for backend migration, so you will have to set your username each major update for now.

contact

Help us fix bugs by reporting any broken behaviour, or ask us questions:

  • email the author: [email protected]
  • contact us on our discord channel: https://discord.gg/PN3vHmjgYz