kalashnikov 0.5.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Kalashnikov #

You start the game by dealing 4 cards to each player and the rest you leave in center, this is the garbage pile, but imagine it contains parts of gun you need to build, which is objective of game: "Build gun from scrap", The parts you need of course is A, K, 4, and 7. The two players rush to build gun, whoever builds gun first shoots and the other takes damage. The first one to deal 20 damage to the opponent wins (though this doesn't always have to be the case)

The card game was introduced on the youtube channel Life of Boris

Changelog #

0.5.1+1 #

  • Updated documentation
  • Fixed a potential bug in Card.hashCode

0.5.1 #

  • Made compatible with dart 2.4.0
  • Formatted lib/players.dart

0.5.0 #

  • Start a changelog
  • Create an example
  • Add analysis options
  • Miscelaneous things to make package healthier

example/main.dart

import 'package:kalashnikov/gamestate.dart';

main() {
  var state = GameState(
    numberOfPlayers: 2,
  );
  state.dealFromScrap();
  print(state.currentCards);
  state.playerDiscard(0, state.scrap.removeLast());
  state.nextTurn();
  print(state.currentCards);
  state.playerDiscard(0, state.scrap.removeLast());
  state.nextTurn();
  print(state.shelf);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  kalashnikov: ^0.5.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:kalashnikov/cards.dart';
import 'package:kalashnikov/gamestate.dart';
import 'package:kalashnikov/players.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health suggestions

Format lib/cards.dart.

Run dartfmt to format lib/cards.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
meta ^1.1.7 1.1.8
pedantic ^1.8.0 1.9.0
Dev dependencies
test any