Created with <3 with dartpad.dev.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
String li = | |
"LoremIpsumDolorSitAmetConsecteturAdipiscingElitSedDoEiusmodTemporIncididuntUtLaboreEtDoloreMagnaAliquaUtEnimAdMinimVeniamQuisNostrudExercitationUllamcoLaborisNisiUtAliquipExEaCommodoConsequatDuisAuteIrureDolorInReprehenderitInVoluptateVelitEsseCillumDoloreEuFugiatNullaPariaturExcepteurSintOccaecatCupidatatNonProidentSuntInCulpaQuiOfficiaDeseruntMollitAnimIdEstLaborum"; | |
String li2 = resistTheActOfSearching(li); | |
print("$li\nlen: ${li.length}\n"); | |
print("$li2\nlen: ${li2.length}\n"); | |
List<String> s1 = search(li,"ipsum", ignore: true).map<String>((Span s) => s(li)).toList(); | |
List<String> s2 = search(li2,"ipsum", ignore: true).map<String>((Span s) => s(li2)).toList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dart:math"; | |
void main() { | |
print(tpx()); | |
} | |
Type Function() tpx = (() => (WPR)); | |
typedef WPR = WallpaperRecord; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Sample nr = Sample(5, "u"); | |
String gtr = "slot2"; | |
try { | |
final res = nr.getInvoker(gtr); | |
print(res); | |
} catch (e, s) { | |
print("\$Error: ${e.runtimeType}"); | |
print(":: $s"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print(ansi.bold.bgMagenta.fgColor255(33)("bold magenta 33 test", true) + | |
ansi.fgColorRGB(244, 192, 14)("#f4c2400e")); | |
print("DartPadのコンソールは基本7色しか対応していないらしい。"); | |
print("255段階のシーケンス中に含まれる5がblinkと解釈されてしまう。"); | |
print("また255段階の指定コードがたまたま33だったためこれが黄色文字と解釈されてしまう。"); | |
print("因みに少なくともWin10のCmdでは想定通りの挙動をする。"); | |
} | |
class AnsiStyles { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef StringProcess = String Function(String); | |
void main() { | |
print("some\r\nlinee\rgoes\n".indent(3).show({" ": "[sp]"})); | |
} | |
extension Lines on String { | |
String eachLines([StringProcess? process]) { | |
final String res = r"([^\r\n]*)(\r\n|\r(?!\n)|(?<!\r)\n)"; | |
final re = RegExp(res, dotAll: true); | |
final List<String> rems = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final fool = Fooler(on3: sayOn3, onElse: sayOnElse); | |
fool(100); | |
} | |
void sayOn3(int n)=>print("$n!"*n); | |
void sayOnElse(int n)=>print("更新: $n"); | |
class Fooler{ | |
int _nr = 0; | |
void Function(int) _on3; | |
void Function(int) _onElse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dart:math"; | |
void main() { | |
final rd = Random.secure(); | |
final List<bool> comp = [true, false, false, false] * 3; | |
List<bool> list = []; | |
bool temp = false; | |
bool fin = false; | |
while (!fin) { | |
list.next(rd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
TemporalTest tt = TemporalTest(); | |
tt.show(); | |
int count = 7; | |
int countI = 1000; | |
final int countI1 = 1200; // to rad 1000 | |
final int countI2 = 90; // to rad 60 | |
final int countI3 = 1000; // to rad 24 | |
for (int i = 1; count >= i; i++) { | |
if (i >= 1 && i <= 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///書式指定文字列処理方式 | |
///Processing Method of Format Specified String | |
void main() { | |
//no-arg | |
final fe1 = FormatException(); | |
//only-msg | |
final fe2 = FormatException("ThisIsMassage"); | |
//msg-and-nn-src | |
final fe3 = FormatException("ThisIsMassage", "Source"); | |
//msg-and-null-src-and-nn-ofs |