Skip to content

Instantly share code, notes, and snippets.

@mono0926
Created April 21, 2022 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mono0926/cba3c5547296a57ce2735e7fb495cdf6 to your computer and use it in GitHub Desktop.
Save mono0926/cba3c5547296a57ce2735e7fb495cdf6 to your computer and use it in GitHub Desktop.
import 'package:test/test.dart';
import 'package:lexicographical_order/lexicographical_order.dart';
void main() {
test('Output', () {
final first = generateOrderKeys(1).first;
print('first: $first'); // a
final previous = between(next: first);
print('previous: $previous'); // N
final next = between(prev: first); // n
print('next: $next');
final firstNext = between(prev: first, next: next); // n
print('firstNext: $firstNext'); // h
// [N, a, h, n]
print([first, previous, next, firstNext]..sort());
final value100 = List.generate(100, (index) => index).fold(
first,
((String result, _) => between(prev: result, next: next)),
);
// mzzzzzzzzzzzzzzzzzzzn
print('value100: $value100');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment