handloose turn carriage return to newline
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
(defNew [&prop :String path]
|
(defNew [&prop :String path]
|
||||||
|
(when (FileSystem.exists path) (set content (File.getContent path)))
|
||||||
(type "") // If the file can't be written to, throw the error right away
|
(type "") // If the file can't be written to, throw the error right away
|
||||||
// Use files with the same extension in the current working directory to determine letter frequencies
|
// Use files with the same extension in the current working directory to determine letter frequencies
|
||||||
(walkDirectory "" (FileSystem.absolutePath "")
|
(walkDirectory "" (FileSystem.absolutePath "")
|
||||||
->file (when (= (Path.extension file) (Path.extension path))
|
->file (when (= (Path.extension file) (Path.extension path))
|
||||||
(learnFrequencies ~(File.getContent ~file))
|
(learnFrequencies (File.getContent file)))))
|
||||||
~charFrequencies)))
|
|
||||||
|
|
||||||
(prop &mut :String content "")
|
(prop &mut :String content "")
|
||||||
(method :Void type [:String str]
|
(method :Void type [:String str]
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
(method incFrequency [:Map<String,Map<String,Int>> m :String c :String following]
|
(method incFrequency [:Map<String,Map<String,Int>> m :String c :String following]
|
||||||
(when c
|
(when c
|
||||||
|
(when (= c "\r") (set c "\n"))
|
||||||
(unless (m.exists following) (dictSet m following (new Map)))
|
(unless (m.exists following) (dictSet m following (new Map)))
|
||||||
(let [followingMap (dictGet m following)]
|
(let [followingMap (dictGet m following)]
|
||||||
(dictSet followingMap c (+ 1 (or (dictGet followingMap c) 0))))))
|
(dictSet followingMap c (+ 1 (or (dictGet followingMap c) 0))))))
|
||||||
|
@@ -107,10 +107,14 @@
|
|||||||
case "\t": "<tab>";
|
case "\t": "<tab>";
|
||||||
default: text;
|
default: text;
|
||||||
};
|
};
|
||||||
var text = new FlxText(text, TEXT_SIZE);
|
var ftext = new FlxText(text, TEXT_SIZE);
|
||||||
text.angle = -spr.angle;
|
ftext.angle = -spr.angle;
|
||||||
text.color = FlxColor.BLACK;
|
ftext.color = FlxColor.BLACK;
|
||||||
spr.stamp(text, Math.floor(SPRITE_SIZE/2) - Math.floor(text.width / 2), Math.floor(SPRITE_SIZE/2) - Math.floor(text.height / 2));
|
|
||||||
|
if (text.length > 1) {
|
||||||
|
ftext.size = 12;
|
||||||
|
}
|
||||||
|
spr.stamp(ftext, Math.floor(SPRITE_SIZE/2) - Math.floor(ftext.width / 2), Math.floor(SPRITE_SIZE/2) - Math.floor(ftext.height / 2));
|
||||||
|
|
||||||
spr.x = SPRITE_SPACING + DIR_ORDER.indexOf(dir) * (SPRITE_SIZE + SPRITE_SPACING);
|
spr.x = SPRITE_SPACING + DIR_ORDER.indexOf(dir) * (SPRITE_SIZE + SPRITE_SPACING);
|
||||||
spr.y = y;
|
spr.y = y;
|
||||||
|
Reference in New Issue
Block a user