Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add required shortest and longest word in crossword #573

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/board_generator_playground/lib/src/crossword.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ typedef CharacterMap = Map<Location, CharacterData>;
class Crossword {
/// {@macro crossword}
Crossword({
required this.largestWordLength,
required this.shortestWordLength,
this.bounds,
this.largestWordLength = 18,
this.shortestWordLength = 3,
});

/// {@macro character_map}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ void main() {
group('$Crossword', () {
group('add', () {
test('adds a down word to the character map', () {
final board = Crossword();
final board = Crossword(
largestWordLength: 18,
shortestWordLength: 3,
);

final url = WordEntry(
word: 'url',
Expand Down Expand Up @@ -40,7 +43,10 @@ void main() {
});

test('adds an across word to the character map', () {
final board = Crossword();
final board = Crossword(
largestWordLength: 18,
shortestWordLength: 3,
);

final url = WordEntry(
word: 'url',
Expand Down Expand Up @@ -80,7 +86,10 @@ void main() {
direction: Direction.across,
);

final board = Crossword()
final board = Crossword(
largestWordLength: 18,
shortestWordLength: 3,
)
..add(behan)
..add(albus);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import 'package:board_generator_playground/src/models/models.dart';
class Crossword1 extends Crossword {
/// {@macro crossword1}
Crossword1({
super.largestWordLength = 18,
super.shortestWordLength = 3,
super.bounds,
super.largestWordLength,
}) {
add(
WordEntry(
Expand Down Expand Up @@ -50,7 +51,10 @@ class Crossword1 extends Crossword {
/// {@endtemplate}
class Crossword2 extends Crossword {
/// {@macro crossword2}
Crossword2() {
Crossword2({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'behan',
Expand Down Expand Up @@ -89,7 +93,10 @@ class Crossword2 extends Crossword {
/// {@endtemplate}
class Crossword3 extends Crossword {
/// {@macro crossword3}
Crossword3() {
Crossword3({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'behan',
Expand Down Expand Up @@ -135,7 +142,10 @@ class Crossword3 extends Crossword {
/// {@endtemplate}
class Crossword4 extends Crossword {
/// {@macro crossword4}
Crossword4() {
Crossword4({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'behan',
Expand Down Expand Up @@ -175,7 +185,10 @@ class Crossword4 extends Crossword {
/// {@endtemplate}
class Crossword5 extends Crossword {
/// {@macro crossword5}
Crossword5() {
Crossword5({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'behan',
Expand Down Expand Up @@ -234,7 +247,10 @@ class Crossword5 extends Crossword {
/// {@endtemplate}
class Crossword6 extends Crossword {
/// {@macro crossword6}
Crossword6() {
Crossword6({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'orchardbankcom',
Expand Down Expand Up @@ -322,7 +338,10 @@ class Crossword6 extends Crossword {
/// {@endtemplate}
class Crossword7 extends Crossword {
/// {@macro crossword7}
Crossword7() {
Crossword7({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'libexec',
Expand Down Expand Up @@ -401,7 +420,10 @@ class Crossword7 extends Crossword {
/// {@endtemplate}
class Crossword8 extends Crossword {
/// {@macro crossword8}
Crossword8() {
Crossword8({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'superman',
Expand Down Expand Up @@ -446,7 +468,10 @@ class Crossword8 extends Crossword {
/// {@endtemplate}
class Crossword9 extends Crossword {
/// {@macro crossword9}
Crossword9() {
Crossword9({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'interchangeability',
Expand Down Expand Up @@ -499,7 +524,10 @@ class Crossword9 extends Crossword {
/// {@endtemplate}
class Crossword10 extends Crossword {
/// {@macro crossword8}
Crossword10() {
Crossword10({
super.largestWordLength = 18,
super.shortestWordLength = 3,
}) {
add(
WordEntry(
word: 'sos',
Expand Down