Fix: count uniChar and split sentence, remove BigFontSize
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
The three little pigs
|
||||
Joseph Jacobs
|
||||
|
||||
Once upon a time there were three little pigs and the time came for them to leave home and seek their fortunes. Before they left, their mother told them "Whatever you do, do it the best that you can because that's the way to get along in the world.
|
||||
|
||||
The first little pig built his house out of straw because it was the easiest thing to do. The second little pig built his house out of sticks. This was a little bit stronger than a straw house. The third little pig built his house out of bricks.
|
||||
|
||||
One night the big bad wolf, who dearly loved to eat fat little piggies, came along and saw the first little pig in his house of straw. He said "Let me in, Let me in, little pig or I'll huff and I'll puff and I'll blow your house in!" "Not by the hair of my chinny chin chin", said the little pig. But of course the wolf did blow the house in and ate the first little pig.
|
||||
|
||||
The wolf then came to the house of sticks. "Let me in, Let me in little pig or I'll huff and I'll puff and I'll blow your house in" "Not by the hair of my chinny chin chin", said the little pig. But the wolf blew that house in too, and ate the second little pig.
|
||||
|
||||
The wolf then came to the house of bricks. "Let me in, let me in" cried the wolf "Or I'll huff and I'll puff till I blow your house in" "Not by the hair of my chinny chin chin" said the pigs. Well, the wolf huffed and puffed but he could not blow down that brick house.
|
||||
|
||||
But the wolf was a sly old wolf and he climbed up on the roof to look for a way into the brick house.
|
||||
|
||||
The little pig saw the wolf climb up on the roof and lit a roaring fire in the fireplace and placed on it a large kettle of water.
|
||||
|
||||
When the wolf finally found the hole in the chimney he crawled down and Kersplash right into that kettle of water and that was the end of his troubles with the big bad wolf.
|
||||
|
||||
The next day the little pig invited his mother over . She said "You see it is just as I told you. The way to get along in the world is to do things as well as you can." Fortunately for that little pig, he learned that lesson. And he just lived happily ever after!
|
||||
@@ -0,0 +1,12 @@
|
||||
The North Wind and The Sun
|
||||
Aesop
|
||||
|
||||
The North Wind and the Sun had a quarrel about which of them was the stronger. While they were disputing with much heat and bluster, a Traveler passed along the road wrapped in a cloak.
|
||||
|
||||
"Let us agree," said the Sun, "that he is the stronger who can strip that Traveler of his cloak."
|
||||
|
||||
"Very well," growled the North Wind, and at once sent a cold, howling blast against the Traveler.
|
||||
|
||||
With the first gust of wind the ends of the cloak whipped about the Traveler's body. But he immediately wrapped it closely around him, and the harder the Wind blew, the tighter he held it to him. The North Wind tore angrily at the cloak, but all his efforts were in vain.
|
||||
|
||||
Then the Sun began to shine. At first his beams were gentle, and in the pleasant warmth after the bitter cold of the North Wind, the Traveler unfastened his cloak and let it hang loosely from his shoulders. The Sun's rays grew warmer and warmer. The man took off his cap and mopped his brow. At last he became so heated that he pulled off his cloak, and, to escape the blazing sunshine, threw himself down in the welcome shade of a tree by the roadside.
|
||||
@@ -0,0 +1,28 @@
|
||||
약손
|
||||
박문하
|
||||
|
||||
여섯 살 난 막내딸이 밖에서 소꿉장난을 하다가 눈에 티가 들어갔다고 울면서 들어왔다.
|
||||
|
||||
어린것들에게는 제 아버지라도 의사라면 무서운 모양인지, 아프지 않게 치료를 해 주마고 아무리 달래어도, 혹시 주사라도 놓을까 보아서 그런지 한층 더 큰 소리를 내어 울면서 할머니에게로 달아나 버린다.
|
||||
|
||||
할머니는 손녀를 품안에 안으시고는 아픈 눈을 가만히 어루만져 주시면서 자장가처럼 혼잣말로 중얼거리시는 것이었다.
|
||||
|
||||
"까지야 까치야 네 새끼 물에 빠지면 내가 건져 줄 터이니 우리 민옥이 눈의 티 좀 꺼내어 다오."
|
||||
|
||||
어린것은 어느 새 울음을 그치고 할머니의 품안에서 쌔근쌔근 잠이 들어 버린다.
|
||||
|
||||
나는 어머니의 손을 물끄러미 바라보았다.
|
||||
|
||||
이제 연세가 여든을 넘으셔서 고목 껍질처럼 마르고 거칠어진 어머니의 손이지만 그 속에는 우리 의사들이 가지지 못한 신비한 어떤 큰 힘이 하나 숨어 있는 것만 같았다.
|
||||
|
||||
옛날에 우리 집은 무척 가난하였기 때문에 우리 형제들은 병이 나도 약 한 첩을 써 보지 못하고 자라났었다.
|
||||
|
||||
우리 형제들이 혹시 병으로 눕게 되면 어머니는 약 대신에 언제나 그 머리맡에 앉으셔서는 저렇게 "까치야 까치야..."를 외시면서 우리들의 아픈 배나 머리를 따뜻한 손길로 쓰다듬어 주셨던 것이다.
|
||||
|
||||
그러면 이상하게도 그 아픈 배나 머리가 씻은 듯이 나았던 것이다.
|
||||
|
||||
그러기에 우리는 어머니의 손을 약손이라고 불렀었다.
|
||||
|
||||
나는 문득 내 손을 펼쳐 보았다. 진한 소독약 냄새가 코를 찔렀다. 현대의 약손이라고 일컫는 의사의 손이다. 그러나 미끈하고 차가운 내 손에는 아무래도 무엇인가 중요한 것 하나가 빠져 있는 것만 같았다.
|
||||
|
||||
어린 손녀의 아픈 눈을 어루만져 주고 계신 어머니의 손을 바라보면서 나는 그 손에서 슈바이처보다도 한층 더 뜨겁고 진한 체온과 정신을 새삼스레 가슴 속 가득히 느꼈다. 그리고 고목 껍질 같은 어머니의 손이 오늘따라 자꾸만 모나리자의 손보다도 더 아름답게 보이는 것이었다.
|
||||
@@ -0,0 +1,26 @@
|
||||
꼬리로 낚시하는 호랑이
|
||||
전래동화
|
||||
|
||||
옛날 어느 추운 겨울에 호랑이가 어슬렁거리며 나타났습니다.
|
||||
'배가 고픈데 뭐 먹을 것 없나?'
|
||||
하지만 하루 종일 돌아다녀도 아무것도 먹지 못했습니다.
|
||||
|
||||
호랑이는 마침내 토끼를 발견했습니다.
|
||||
"이놈! 토끼야!"
|
||||
호랑이는 토끼를 한 입에 잡아먹으려고 입을 크게 벌렸습니다. 그때 토끼는 살기 위해 꾀를 내었어요.
|
||||
"저 하나로 배가 부르겠어요? 먹을 것이 무척 많은 데가 있으니 따라오세요."
|
||||
"먹을 게 무척 많다고?"
|
||||
"그럼요!"
|
||||
호랑이는 눈을 깜빡이며 토끼를 따라갔습니다.
|
||||
|
||||
토끼가 호랑이를 데리고 간 곳은 얼음이 꽁꽁 언 강이었습니다. 낚시꾼들이 만들어 놓은 구멍이 여러 개 보였습니다.
|
||||
"호랑이님 이 구멍에 꼬리를 집어넣으세요."
|
||||
"그래? 이렇게 꼬리를 집어넣으라고?"
|
||||
"예, 물고기 떼가 꼬리에 매달려 묵직해지면 얼른 낚아채는 겁니다."
|
||||
"알았다!"
|
||||
|
||||
겨울바람이 쌩쌩 불었어요. 그래도 호랑이는 꼬리를 얼음 구멍에 집어넣고 오래도록 기다렸습니다.
|
||||
'꼬리가 묵직해지는 것으로 보아 이제 물고기가 많이 걸렸나 봐'
|
||||
호랑이는 꼬리를 낚아챘습니다. 하지만 꼬리가 얼음에 꽁꽁 얼어 움직이지 않았습니다. 아무리 잡아당겨도 꼬리만 아플 뿐이었습니다.
|
||||
"헤헤헤~ 호랑이 아저씨! 열심히 고기를 낚으세요."
|
||||
목숨을 건진 토끼는 산으로 뛰어갔습니다.
|
||||
@@ -0,0 +1,18 @@
|
||||
은혜 갚은 까치
|
||||
전래동화
|
||||
|
||||
옛날 한 선비가 과거를 보러 한양를 가기 위해 산을 오르다 구렁이에게 잡혀먹을 뻔한 새끼 까치를 발견했습니다. 그래서 선비는 새끼 까치를 구해주기 위해 구렁이를 죽였습니다.
|
||||
|
||||
그리고 계속 산을 건너는데 어느덧 깜깜한 밤이 되어 선비는 하룻밤 신세질 곳을 찾다가 집 한채를 발견하게 되었습니다. 선비가 그 집을 찾아가자 아름다운 여인이 나와서 선비가 하룻밤 머물 수 있도록 허락해 주었습니다.
|
||||
|
||||
한밤 중 잠을 자던 선비는 갑자기 몸이 답답함을 느꼈습니다. 잠에서 깨어나 보니 커다란 구렁이 한마리가 자신의 몸을 칭칭 감고 있었습니다. 선비는 놀라서 왜 나를 공격하는 것이냐고 하자 이 구렁이는 아까 낮에 선비가 죽인 구렁이의 아내였고 하룻밤만 지나면 용이 되어 승천할 수 있었는데, 선비가 까치를 구하기 위해 죽이는 바람에 혼자남게 되어 원한을 품게 되었다고 하였습니다.
|
||||
|
||||
선비는 구렁이에게 한번만 자비를 베풀어 달라고 했지만 이미 남편을 잃은 원한을 가진 구렁이는 선비를 풀어주지 않았습니다. 대신 구렁이는 날이 새기 전에 종이 세 번 울리면 선비를 풀어주겠다고 약속을 했습니다.
|
||||
|
||||
구렁이에게 묶인 선비는 종을 칠 방법이 없어서 '구렁이에게 꼼짝없이 죽는구나...' 라며 포기를 했습니다. 새벽이 지나고 아침해가 뜨기 전까지 종이 안쳐지자 구렁이는 선비를 잡아먹으려고 했습니다. 이때 멀리선가 종 치는 소리가 들려 왔습니다.
|
||||
|
||||
종이 세번 울리자 구렁이는 남편의 복수를 하지 못한 것에 분해 하며 용이 되어 승천하게 되었습니다.
|
||||
|
||||
구사일생으로 목숨을 건진 선비는 누가 종을 울렸는지 궁금해서 종이 있는 곳으로 가보니 그곳에 어미까치가 머리가 깨져서 죽어 있었습니다. 새끼 까치를 살려준 은혜를 갚기 위해 어미까치는 선비를 살리기 위해 자신의 몸을 던져서 종을 울린 것이였어요.
|
||||
|
||||
선비는 은혜를 갚고 죽은 까치들을 거둬 잘 묻어주었습니다.
|
||||
@@ -0,0 +1,14 @@
|
||||
서시
|
||||
윤동주
|
||||
|
||||
죽는 날까지 하늘을 우러러
|
||||
한 점 부끄럼이 없기를
|
||||
잎새에 이는 바람에도
|
||||
나는 괴로워했다.
|
||||
|
||||
별을 노래하는 마음으로
|
||||
모든 죽어가는 것을 사랑해야지.
|
||||
그리고 나한테 주어진 길을
|
||||
걸어가야겠다.
|
||||
|
||||
오늘 밤에도 별이 바람에 스치운다.
|
||||
@@ -45,6 +45,8 @@ function TypingExamButton(x, y) {
|
||||
|
||||
this.mainText.anchor.set(0, 0.5);
|
||||
this.mainText.x = 100;
|
||||
console.log(this.mainText.width);
|
||||
// this.mainText.width = 100;
|
||||
// this.setMainText("");
|
||||
// this.addIcon("tile_choco");
|
||||
// this.setIconSize(40);
|
||||
@@ -116,7 +118,7 @@ TypingExamButton.prototype.setTypingRecordText = function(record) {
|
||||
}
|
||||
|
||||
TypingExamButton.prototype.makeWritingNameText = function() {
|
||||
var textWidth = 250;
|
||||
var textWidth = 232;
|
||||
|
||||
var style = { };
|
||||
style.boundsAlignH = "left";
|
||||
|
||||
@@ -117,7 +117,7 @@ TypingExamination.prototype.makeDefaultText = function(x, y) {
|
||||
var defaultText = game.add.text(x, y, "");
|
||||
defaultText.anchor.set(0, 0.5);
|
||||
defaultText.font = "Nanum Gothic Coding";
|
||||
defaultText.fontSize = 26;
|
||||
defaultText.fontSize = TypingExamination.DEFAULT_FONT_SIZE;
|
||||
defaultText.fontWeight = "normal";
|
||||
defaultText.style.fill = "white";
|
||||
|
||||
@@ -157,25 +157,26 @@ TypingExamination.prototype.makeInputlineText = function(x, y) {
|
||||
var CONTENT_TEXT_WIDTH = 800;
|
||||
var CONTENT_UNDERLINE_OFFSET_Y = 17;
|
||||
var TYPING_CONTENT_UNDERLINE_OFFSET_Y = 5;
|
||||
var BIG_FONT_SIZE = 28;
|
||||
|
||||
// current text
|
||||
this.textBackTextOnly = this.makeDefaultText(x, y);
|
||||
this.textBackTextOnly.fontSize = BIG_FONT_SIZE;
|
||||
this.textBackTextOnly.fontSize = TypingExamination.DEFAULT_FONT_SIZE;
|
||||
this.textBackTextOnly.style.fill = TypingExamination.COLOR_NOT_INPUT_STRING;
|
||||
this.textBackTextOnly.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
console.log(this.textBackTextOnly);
|
||||
|
||||
this.textNextLetterIndicator = this.makeDefaultText(x, y);
|
||||
this.textNextLetterIndicator.fontSize = BIG_FONT_SIZE;
|
||||
this.textNextLetterIndicator.fontSize = TypingExamination.DEFAULT_FONT_SIZE;
|
||||
this.textNextLetterIndicator.style.fill = TypingExamination.COLOR_NEXT_INPUT_STRING;
|
||||
this.textNextLetterIndicator.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
this.textNextLetterIndicator.style.backgroundColor = TypingExamination.COLOR_NEXT_INPUT_BACKGROUND_STRING;
|
||||
|
||||
this.textCorrectText = this.makeDefaultText(x, y);
|
||||
this.textCorrectText.fontSize = BIG_FONT_SIZE;
|
||||
this.textCorrectText.fontSize = TypingExamination.DEFAULT_FONT_SIZE;
|
||||
this.textCorrectText.style.fill = TypingExamination.COLOR_CORRECT_INPUT_STRING;
|
||||
this.textCorrectText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2)
|
||||
this.textCorrectText.style.backgroundColor = TypingExamination.COLOR_CORRECT_INPUT_BACKGROUND_STRING;
|
||||
console.log(this.textCorrectText);
|
||||
|
||||
var graphics = game.add.graphics(0, 0);
|
||||
graphics.lineStyle(1, 0x303030, 1);
|
||||
@@ -189,7 +190,7 @@ TypingExamination.prototype.makeTextContents = function() {
|
||||
var CONTENT_TEXT_WIDTH = 800;
|
||||
|
||||
var TYPING_CONTENT_X = 150;
|
||||
var TYPING_CONTENT_Y = 330;
|
||||
var TYPING_CONTENT_Y = 340;
|
||||
|
||||
var LINE_POS_X = 130;
|
||||
|
||||
@@ -198,10 +199,9 @@ TypingExamination.prototype.makeTextContents = function() {
|
||||
|
||||
var DONE_OFFSET_Y = 0;
|
||||
var INPUT_OFFSET_Y = 120;
|
||||
var PREVIEW_OFFSET_Y = 190;
|
||||
var PREVIEW_OFFSET_Y = 170;
|
||||
|
||||
var TEXT_HEIGHT = 50;
|
||||
var BIG_FONT_SIZE = 28;
|
||||
|
||||
|
||||
// input content
|
||||
@@ -252,7 +252,7 @@ TypingExamination.prototype.makeTextContents = function() {
|
||||
this.inputTextContent.anchor.set(0, 0.5);
|
||||
this.inputTextContent.canvasInput.value('');
|
||||
this.inputTextContent.canvasInput.focus();
|
||||
this.inputTextContent.canvasInput.fontSize(BIG_FONT_SIZE);
|
||||
this.inputTextContent.canvasInput.fontSize(TypingExamination.DEFAULT_FONT_SIZE);
|
||||
// this.inputTextContent.canvasInput.fontWeight("");
|
||||
this.inputTextContent.canvasInput.fontFamily("Nanum Gothic Coding");
|
||||
this.inputTextContent.canvasInput.placeHolder("");
|
||||
@@ -409,6 +409,7 @@ TypingExamination.prototype.completeLoadingWriting = function() {
|
||||
game.load.onLoadComplete.remove(this.completeLoadingWriting, this);
|
||||
|
||||
var writing = game.cache.getText("writing");
|
||||
// console.log(writing);
|
||||
var examinationContent = writing.split("\n");
|
||||
|
||||
var count = examinationContent.length;
|
||||
@@ -745,6 +746,8 @@ TypingExamination.TYPING_CONTENT_PREVIEW_COUNT = 4;
|
||||
TypingExamination.TYPING_CONTENT_DONE_COUNT = 4;
|
||||
TypingExamination.TYPING_COUNT_PLUS_ENTER = 1;
|
||||
|
||||
TypingExamination.DEFAULT_FONT_SIZE = 26;
|
||||
|
||||
TypingExamination.COLOR_NOT_INPUT_STRING = MainColor.DARK_GRAY_STRING;
|
||||
TypingExamination.COLOR_NEXT_INPUT_STRING = MainColor.GOLD_STRING;
|
||||
TypingExamination.COLOR_CORRECT_INPUT_STRING = MainColor.YELLOW_STRING;
|
||||
|
||||
@@ -105,9 +105,14 @@ TypingTextManager.prototype.makeExaminationContents = function(arr) {
|
||||
// this.add(arr);
|
||||
for(var i = 0; i < arr.length; i++) {
|
||||
var sentence = arr[i];
|
||||
if(sentence.length == 0)
|
||||
// console.log(sentence);
|
||||
// console.log(sentence.length);
|
||||
|
||||
var uniCharCount = StringUtil.getUnicodeAlphabetCount(sentence);
|
||||
if(uniCharCount == 0)
|
||||
continue;
|
||||
if(sentence.length > TypingTextManager.SENTENCE_MAX_CHARACTER)
|
||||
|
||||
if(uniCharCount > TypingTextManager.SENTENCE_MAX_CHARACTER)
|
||||
this.add(this.getSplitedSentences(sentence));
|
||||
else
|
||||
this.add(sentence);
|
||||
|
||||
+7
-6
@@ -72,7 +72,7 @@ QUnit.test( "AppList", function( assert ) {
|
||||
(function(jsonData) {
|
||||
assert.equal(jsonData.appGroup, appGroup, "#0 appGroup : typing practice, Korean");
|
||||
assert.equal(jsonData.appData.appList.length, 8, "appList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 6, "activeAppList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 7, "activeAppList");
|
||||
assert.equal(jsonData.appData.highestRecordList.length, 8, "highestRecordList");
|
||||
asyncTypingPracticeKorean();
|
||||
}).bind(this),
|
||||
@@ -114,7 +114,7 @@ QUnit.test( "AppList", function( assert ) {
|
||||
(function(jsonData) {
|
||||
assert.equal(jsonData.appGroup, appGroup, "#1 appGroup : typing test, Korean");
|
||||
assert.equal(jsonData.appData.appList.length, 10, "appList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 8, "activeAppList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 7, "activeAppList");
|
||||
assert.equal(jsonData.appData.highestRecordList.length, 10, "highestRecordList");
|
||||
asyncTestKorean();
|
||||
}).bind(this),
|
||||
@@ -155,9 +155,9 @@ QUnit.test( "AppList", function( assert ) {
|
||||
language,
|
||||
(function(jsonData) {
|
||||
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, Korean");
|
||||
assert.equal(jsonData.appData.appList.length, 4, "appList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 4, "activeAppList");
|
||||
assert.equal(jsonData.appData.highestRecordList.length, 4, "highestRecordList");
|
||||
assert.equal(jsonData.appData.appList.length, 5, "appList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 5, "activeAppList");
|
||||
assert.equal(jsonData.appData.highestRecordList.length, 5, "highestRecordList");
|
||||
asyncExamKorean();
|
||||
}).bind(this),
|
||||
(function(jsonData) {
|
||||
@@ -176,7 +176,7 @@ QUnit.test( "AppList", function( assert ) {
|
||||
language,
|
||||
(function(jsonData) {
|
||||
assert.equal(jsonData.appGroup, appGroup, "#2 appGroup : typing exam, English");
|
||||
console.log(jsonData.appData);
|
||||
// console.log(jsonData.appData);
|
||||
assert.equal(jsonData.appData.appList.length, 4, "appList");
|
||||
assert.equal(jsonData.appData.activeAppList.length, 4, "activeAppList");
|
||||
assert.equal(jsonData.appData.highestRecordList.length, 4, "highestRecordList");
|
||||
@@ -841,6 +841,7 @@ QUnit.test( "TypingTextManager - makeExaminationContents", function( assert ) {
|
||||
typingTextMan.init();
|
||||
typingTextMan.makeExaminationContents(sentences);
|
||||
let contents = typingTextMan.getContents();
|
||||
// console.log(contents.length);
|
||||
|
||||
assert.equal(contents[0], "냉면 / 김남천", "addTextArray - line 1");
|
||||
assert.equal(contents[1], "'냉면'이라는 말에 '평양'이 붙어서 '평양냉면'이라야 ", "addTextArray - line 2");
|
||||
|
||||
Reference in New Issue
Block a user