scrabble 1.0.0 copy "scrabble: ^1.0.0" to clipboard
scrabble: ^1.0.0 copied to clipboard

An API and command line tool for finding and scoring legal Scrabble words

example/example.dart

import 'package:scrabble/scrabble.dart';

void main(List<String> args) {
  final scrabble = Scrabble();
  // Lookup arguments
  for (var word in args) {
    var matches = scrabble.lookup(word, expand: true);
    printMatches(scrabble, 'Lookup', word, matches);
  }
  // Get anagrams of arguments
  for (var word in args) {
    var matches = scrabble.anagram(word, expand: true, sort: true);
    printMatches(scrabble, 'Anagram', word, matches);
  }
}

// Print matches with scores
void printMatches(
    Scrabble scrabble, String command, String word, Set<String> matches) {
  print('$command $word $matches');
  for (var match in matches) {
    print('Score $match = ${scrabble.score(match)}');
  }
}
2
likes
130
pub points
11%
popularity

Publisher

unverified uploader

An API and command line tool for finding and scoring legal Scrabble words

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

archive, args, build

More

Packages that depend on scrabble