From bbff5a3d7c59cbe28dedf36b13508bd0f56f665e Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Sun, 18 Jan 2015 10:05:37 +0700 Subject: [PATCH 01/17] problem variable --- problems/variables/problem.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/problems/variables/problem.md b/problems/variables/problem.md index 7b818fe3..fef33fdd 100644 --- a/problems/variables/problem.md +++ b/problems/variables/problem.md @@ -1,34 +1,35 @@ --- -# VARIABLES +# Biến -A variable is a name that can reference a specific value. Variables are declared using `var` followed by the variable's name. +Một biết là một tên (định danh) mà có thể tham chiếu (reference) đến một giá trị nhất định. Một biến được khai báo bằng việc sử dụng từ khóa `var` theo sau là tên biến. -Here's an example: +Sau đây là một ví dụ: ```js var example; ``` -The above variable is **declared**, but it isn't defined (it does not yet reference a specific value). +Biết `example` là đã được **khai báo**, nhưng nó chưa được định nghĩa. (Nó sẽ chưa tham chiếu đến một giá trị nhất định nào cả). -Here's an example of defining a variable, making it reference a specific value: +Dưới đây là một ví dụ của việc định nghĩa một biến, làm cho nó tham chiếu đến một giá trị nhất định. ```js var example = 'some string'; ``` -Note that it is **declared** using `var` and uses the equals sign to **define** the value that it references. This is colloquially known as "Making a variable equal a value". +Chú ý rằng biến trên đã được **khai báo** bằng việc sử dụng từ khóa `var` và sử dụng dấu = để `định nghĩa` giá trị mà nó tham chiếu đến. Đây là một cách thông dụng được biết đến như là "Làm một biến bằng một giá trị". -Create a file named `variables.js`. +Hãy tạo một file và đặt tên là `variables.js` -In that file declare a variable named `example`. +Bên trong file đó, chúng ta khai báo một biến tên là `example`. -**Make the variable `example` equal to the value `'some string'`.** -Then use `console.log()` to print the `example` variable to the console. +**Làm cho biến `example` bằng giá trị `'some string'`.** -Check to see if your program is correct by running this command: +Sau đó các bạn sử dụng câu lệnh `console.log()` để biến `example` ra ngoài màn hình console. + +Kiểm tra xem nếu chương trình của bạn chạy chính xác bằng việc thực hiện lệnh sau: `javascripting verify variables.js` --- From 6039e3dcd027a7f6de3fcd32c9a4d6f04bb1dc96 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Sun, 18 Jan 2015 10:11:33 +0700 Subject: [PATCH 02/17] change some info --- package.json | 6 +++--- problems/variables/problem.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 459f433d..ef6816b1 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { - "name": "javascripting", + "name": "javascripting-vi", "description": "Learn JavaScript by adventuring around in the terminal.", "version": "1.9.1", "repository": { - "url": "git://github.com/sethvincent/javascripting.git" + "url": "git://github.com/NgaNguyenDuy/javascripting-vi.git" }, "author": "sethvincent", "bin": { - "javascripting": "index.js" + "js-vi": "index.js" }, "preferGlobal": true, "dependencies": { diff --git a/problems/variables/problem.md b/problems/variables/problem.md index fef33fdd..1aa8a300 100644 --- a/problems/variables/problem.md +++ b/problems/variables/problem.md @@ -2,7 +2,7 @@ # Biến -Một biết là một tên (định danh) mà có thể tham chiếu (reference) đến một giá trị nhất định. Một biến được khai báo bằng việc sử dụng từ khóa `var` theo sau là tên biến. +Một `biến` là một tên (định danh) mà có thể tham chiếu (reference) đến một giá trị nhất định. Một biến được khai báo bằng việc sử dụng từ khóa `var` theo sau là tên biến. Sau đây là một ví dụ: From 4052801c01f424c5ea73894f52dae10a22fd5122 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Sun, 18 Jan 2015 10:14:29 +0700 Subject: [PATCH 03/17] change version and author --- .tern-port | 1 + package.json | 7 +++++-- problems/variables/problem.md | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .tern-port diff --git a/.tern-port b/.tern-port new file mode 100644 index 00000000..bb852ac2 --- /dev/null +++ b/.tern-port @@ -0,0 +1 @@ +38345 \ No newline at end of file diff --git a/package.json b/package.json index ef6816b1..9da9a1ee 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "name": "javascripting-vi", "description": "Learn JavaScript by adventuring around in the terminal.", - "version": "1.9.1", + "version": "0.0.1", "repository": { "url": "git://github.com/NgaNguyenDuy/javascripting-vi.git" }, - "author": "sethvincent", + "author": [ + "sethvincent", + "NgaNguyenDuy" + ], "bin": { "js-vi": "index.js" }, diff --git a/problems/variables/problem.md b/problems/variables/problem.md index 1aa8a300..16567b21 100644 --- a/problems/variables/problem.md +++ b/problems/variables/problem.md @@ -31,5 +31,5 @@ Sau đó các bạn sử dụng câu lệnh `console.log()` để biến `exampl Kiểm tra xem nếu chương trình của bạn chạy chính xác bằng việc thực hiện lệnh sau: -`javascripting verify variables.js` +`js-vi verify variables.js` --- From 3bf902f9e81e09a12610ac2958dcc20ba1076c85 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Sun, 18 Jan 2015 10:57:11 +0700 Subject: [PATCH 04/17] update readme --- .gitignore | 1 + .tern-port | 1 - problems/variables/solution.md | 6 ++-- readme.md | 62 +++++++++++++++------------------- troubleshooting.md | 4 +-- 5 files changed, 34 insertions(+), 40 deletions(-) delete mode 100644 .tern-port diff --git a/.gitignore b/.gitignore index 9daa8247..3ba99730 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store node_modules +.tern-port \ No newline at end of file diff --git a/.tern-port b/.tern-port deleted file mode 100644 index bb852ac2..00000000 --- a/.tern-port +++ /dev/null @@ -1 +0,0 @@ -38345 \ No newline at end of file diff --git a/problems/variables/solution.md b/problems/variables/solution.md index 02fc9361..2dd7e8f7 100644 --- a/problems/variables/solution.md +++ b/problems/variables/solution.md @@ -2,10 +2,10 @@ # YOU CREATED A VARIABLE! -Nice work. +Làm tốt lắm. -In the next challenge we will look at strings more closely. +Trong thử thách tiếp theo, chúng ta sẽ xem xét các chuỗi chặt chẽ hơn. -Run `javascripting` in the console to choose the next challenge. +Hãy chạy lệnh `js-vi` trên màn hình console để chọn thử thách tiếp theo. --- diff --git a/readme.md b/readme.md index fc8ec78b..406785b1 100644 --- a/readme.md +++ b/readme.md @@ -1,68 +1,62 @@ # JAVASCRIPTING [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/sethvincent/javascripting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -> Learn JavaScript by adventuring around in the terminal. +> _Tìm kiếm những hướng dẫn tương tự như thế này? Hãy truy cập website [nodeschool.io](http://nodeschool.io)._ -> _Looking for more interactive tutorials like this? Go to [nodeschool.io](http://nodeschool.io)._ +> Đây là một workshop trong nodeschool.io mà tôi fork về. Tất cả các vấn đề về workshop này các bạn có thể tạo issue repo này hoặc tại nodeschool/discussions: https://github.com/nodeschool/discussions -## Install Node.js -Make sure Node.js is installed on your computer. +## Cài đặt Node.js -Install it from [nodejs.org/download](http://nodejs.org/download) +Hãy chắc chắn rằng Node.js là đã được cài đặt trên máy của bạn. -### Install `javascripting` with `npm` +Cài đặt nó từ [nodejs.org/download](http://nodejs.org/download) -Open your terminal and run this command: +### Cài đặt `javascripting-vi` với `npm` + +Hãy mở terminal của bạn và chạy câu lệnh sau: ``` -npm install --global javascripting +npm install --global javascripting-vi ``` -The `--global` option installs this module globally so that you can run it as a command in your terminal. +Tùy chọn `--global` hay `-g` sẽ cài đặt module này trên toàn hệ điều hành của bạn, tức là bạn có thể chạy nó như một command trên terminal của mình. -## Run the workshop +## Bắt đầu thử thách nào!! -Open your terminal and run the following command: +Hãy mở terminal của mình lên và chạy: ``` -javascripting +js-vi ``` -You'll see the menu: +Bạn sẽ thấy: ![javascripting screenshot](screenshot.png) -Navigate the menu with the up & down arrow keys. - -Choose a challenge by hitting enter. +Di chuyển trong menu bằng các phím lên(up) và xuống(down). +Chọn một thử thách bằng việc ấn enter. -### Take a look at this gif that shows the first challenge: +### Ảnh gif sau sẽ cho thấy thử thách đầu tiên: ![first challenge](javascripting.gif) -In the gif I'm using the command line editor `nano` ([here are some basic usage tips for nano](https://github.com/sethvincent/dev-envs-book/blob/master/chapters/05-editors.md#nano)). - -You can use any editor you like. - -[atom](http://atom.io) or [brackets](http://brackets.io/) are both good options. - -## Need help with an exercise? - -Open an issue in the nodeschool/discussions repo: https://github.com/nodeschool/discussions +Trong ảnh gif, Tôi sử dụng trình soạn thảo `nano`([here are some basic usage tips for nano](https://github.com/sethvincent/dev-envs-book/blob/master/chapters/05-editors.md#nano)). +Bạn có thể sử dụng bất kì trình soạn thảo mà bạn yêu thích: -Include the name `javascripting` and the name of the challenge you're working on in the title of the issue. +- [Sublime Text (2 or 3)](http://www.sublimetext.com/) +- [Emacs](http://www.gnu.org/software/emacs/) +- [Vim](http://www.vim.org/) +- [Atom](http://atom.io) +- [Brackets](http://brackets.io/) +- [Webstorm](https://www.jetbrains.com/webstorm/) -## TODOS: +## Nếu bạn cần sự giúp đỡ? -Add these challenges: +Hãy mở một issue trong repo nodeschool/discussions: https://github.com/nodeschool/discussions -- "ACCESSING ARRAY VALUES" -- "OBJECT KEYS" -- "FUNCTION RETURN VALUES" -- "THIS" -- "SCOPE" +Đừng quên bao gồm tên của workshop - `javascripting` và tên của thử thách (challenge) mà bạn đang làm việc trong tiêu đề của issue. ## License diff --git a/troubleshooting.md b/troubleshooting.md index 79232691..09d1bf6b 100644 --- a/troubleshooting.md +++ b/troubleshooting.md @@ -1,6 +1,6 @@ --- -# O-oh, something isn't working. -# But don't panic! +# O-oh, có điều gì đó không đúng. +# Nhưng đừng hoảng sợ! --- ## Check your solution: From ab7fc4a2bd08da2d1400de3f7952c9751a20f649 Mon Sep 17 00:00:00 2001 From: Nga Nguyen Duy Date: Sun, 18 Jan 2015 04:00:09 +0700 Subject: [PATCH 05/17] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 406785b1..752e7428 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ > _Tìm kiếm những hướng dẫn tương tự như thế này? Hãy truy cập website [nodeschool.io](http://nodeschool.io)._ -> Đây là một workshop trong nodeschool.io mà tôi fork về. Tất cả các vấn đề về workshop này các bạn có thể tạo issue repo này hoặc tại nodeschool/discussions: https://github.com/nodeschool/discussions +> Đây là một workshop trong nodeschool.io mà tôi fork về. Tất cả các vấn đề về workshop này các bạn có thể tạo issue tại repo này hoặc tại nodeschool/discussions: https://github.com/nodeschool/discussions ## Cài đặt Node.js From 5504b5e0996a3bdf30c65c0bb9bfd78c0b8b0e75 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 13 Apr 2015 15:01:12 +0700 Subject: [PATCH 06/17] translated instroduction --- problems/introduction/problem.md | 25 ++++++++++++++----------- problems/introduction/solution.md | 11 ++++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/problems/introduction/problem.md b/problems/introduction/problem.md index 0421681a..e57d1720 100644 --- a/problems/introduction/problem.md +++ b/problems/introduction/problem.md @@ -1,33 +1,36 @@ --- # INTRODUCTION -To keep things organized, let's create a folder for this workshop. +Để giữ cho mọi thứ có tổ chức tốt, chúng ta hãy tạo ra một thư mục cho workshop này. -Run this command to make a directory called `javascripting` (or something else if you like): +Chạy câu lệnh sau để tạo một thư mục tên là `javascripting-vi` (hay bất cứ tên gì bạn muốn): -`mkdir javascripting` +`mkdir javascripting-vi` -Change directory into the `javascripting` folder: +Di chuyển vào bên trong thư mục `javascripting-vi`: -`cd javascripting` +`cd javascripting-vi` -Create a file named `introduction.js`: +Tạo một tệp tin là `introduction.js`: -`touch introduction.js` or if you're on windows, `type NUL > introduction.js` -Open the file in your favorite editor, and add this text: +`touch introduction.js` Hoặc nếu như bạn đang sử dụng windows, `type NUL > introduction.js` (với `type` là một phần của câu lệnh!) + +Mở tệp tin bằng trình soạn thảo(editor) yêu thích của bạn và thêm vào nội dung sau: + ```js console.log('hello'); ``` Save the file, then check to see if your program is correct by running this command: +Lưu tập tin, sau đó kiểm tra xem chương trình của bạn đã chính xác hay chưa bằng cách chạy lệnh sau: + `javascripting verify introduction.js` --- - - -> **Need help?** View the README for this workshop: http://github.com/sethvincent/javascripting + +> **Cần trợ giúp?** Xem README cho workshop này: https://github.com/nganguyenduy/javascripting-vi diff --git a/problems/introduction/solution.md b/problems/introduction/solution.md index d91cba55..800a8bcf 100644 --- a/problems/introduction/solution.md +++ b/problems/introduction/solution.md @@ -1,21 +1,22 @@ --- -# YOU DID IT! +# BẠN LÀM ĐƯỢC RỒI! Anything between the parentheses of `console.log()` are printed to the terminal. +Bất cứ điều gì giữa dấu ngoặc đơn của `console.log()` là được in ra thiết bị đầu cuối của bạn (terminal). -So this: +Vì vậy: ```js console.log('hello'); ``` -prints `hello` to the terminal. +sẽ in ra chuỗi `hello` trên terminal của bạn. -Currently we are printing a **string** of characters to the terminal: `hello`. In the next challenge we focus on learning about **variables**. +Trong thử thách tiếp theo, chúng tôi tìm hiểu về **biến**. -Run `javascripting` in the console to choose the next challenge. +Chạy `javascripting` trong console của bạn để lựa chọn các thử thách tiếp theo. --- From b75247c2000ebbc83e5aaf607cb7fa9d2a5cecd6 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 13 Apr 2015 15:01:43 +0700 Subject: [PATCH 07/17] translated strings --- problems/strings/problem.md | 21 ++++++++++++--------- problems/strings/solution.md | 8 ++++---- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/problems/strings/problem.md b/problems/strings/problem.md index c9ffdbda..502424da 100644 --- a/problems/strings/problem.md +++ b/problems/strings/problem.md @@ -1,31 +1,34 @@ --- -# STRINGS +# CHUỖI -A **string** is any value surrounded by quotes. +Một **chuỗi** là bất kì giá trị nào được bao quanh bởi dấu ngoặc kép. -It can be single or double quotes: +Nó có thể là dấu nháy đơn hoặc dấu nháy kép: ```js 'this is a string' "this is also a string" ``` +# CHÚ Ý -Try to stay consistent. In this workshop we'll only use single quotes. +Trong workshop này, chúng ta chỉ sử dụng dấu nháy đơn. -For this challenge, create a file named `strings.js`. +## Thử thách:: -In that file create a variable named `someString` like this: +Đối với thử thách lần này, bạn hãy tạo một tệp tin là `strings.js`. + +Trong tệp tin đó, hãy tạo một biến là `someString` như sau: ```js var someString = 'this is a string'; ``` -Use `console.log` to print the variable **someString** to the terminal. +Sử dụng `console.log` để in ra biến **someString** trên terminal của bạn. -Check to see if your program is correct by running this command: +Kiểm tra xem chương trình của bạn chính xác hay chưa bằng cách chạy lênh sau: -`javascripting verify strings.js` +`javascripting-vi verify strings.js` --- diff --git a/problems/strings/solution.md b/problems/strings/solution.md index 69accf89..f114eceb 100644 --- a/problems/strings/solution.md +++ b/problems/strings/solution.md @@ -1,11 +1,11 @@ --- -# SUCCESS. +# THÀNH CÔNG. -You are getting used to this string stuff! +Bạn đã bắt đầu làm quen với chuỗi! -In the next challenges we will cover how to manipulate strings. +Trong thử thách tiếp theo, chúng ta sẽ tìm hiểu làm thế nào để thao tác với các chuỗi. -Run `javascripting` in the console to choose the next challenge. +Chạy lệnh `javascripting-vi` trên màn hình console để chọn thử thách tiếp theo cho mình. --- From 8e2737d9b4b00c2c1bce129f0527d37c83bc2fec Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 13 Apr 2015 15:02:23 +0700 Subject: [PATCH 08/17] translated string length --- problems/string-length/problem.md | 27 ++++++++++++++++----------- problems/string-length/solution.md | 8 +++++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/problems/string-length/problem.md b/problems/string-length/problem.md index ddb43cb9..2a38dd46 100644 --- a/problems/string-length/problem.md +++ b/problems/string-length/problem.md @@ -1,30 +1,35 @@ --- -# STRING LENGTH +# Chiều dài của chuỗi -You will often need to know how many characters are in a string. +Bạn sẽ cần phải biết có bao nhiêu kí tự trong cùng một chuỗi. -For this you will use the `.length` property. Here's an example: +Để làm điều này, bạn có thể sử dụng thuộc tính `.length`. Đây là một ví dụ: ```js var example = 'example string'; example.length ``` -Make sure there is a period between `example` and `length`. +# CHÚ Ý -The above code will return a **number** for the total number of characters in the string. +Hãy chắc chắn có một dấu chấm giữa `example` và `length`. -Create a file named string-length.js. +Đoạn mã trên sẽ trả về một giá trị kiểu **number** đại diện cho tổng các kí tự trong một chuỗi. -In that file, create a variable named `example`. -**Assign the string `'example string'` to the variable `example`.** +## Thử thách: -Use `console.log` to print the **length** of the string to the terminal. +Tạo một tệp tin là `string-length.js`. -**Check to see if your program is correct by running this command:** +Trong tệp tin đó, hãy tạo một biến là `example`. -`javascripting verify string-length.js` +** Gán một chuỗi `'example string'` cho một biến là `example`.** + +Sử dụng `console.log` để in ra **length** của một chuỗi trên terminal. + +**Hãy kiểm tra xem chương trình của bạn đã chạy đúng hay chưa bằng cách sử dụng lệnh:** + +`javascripting-vi verify string-length.js` --- diff --git a/problems/string-length/solution.md b/problems/string-length/solution.md index 67a6d0be..db927e80 100644 --- a/problems/string-length/solution.md +++ b/problems/string-length/solution.md @@ -1,9 +1,11 @@ --- -# WIN: 14 CHARACTERS +# YUP: 14 kí tự -You got it! The string `example string` has 14 characters. +Chính xác! Chuỗi `example string` có 14 kí tự. + + +Chạy `javascripting-vi` lệnh trên terminal của bạn để chọn các thử thách tiếp theo. -Run `javascripting` in the console to choose the next challenge. --- From 0cb68aa8318a5a90cf278adb31012597f601e6cf Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 13 Apr 2015 15:02:44 +0700 Subject: [PATCH 09/17] translated revising --- problems/revising-strings/problem.md | 28 +++++++++++++-------------- problems/revising-strings/solution.md | 7 ++++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/problems/revising-strings/problem.md b/problems/revising-strings/problem.md index b702bd99..37eadb46 100644 --- a/problems/revising-strings/problem.md +++ b/problems/revising-strings/problem.md @@ -1,12 +1,12 @@ --- -# REVISING STRINGS +# SỬA ĐỔI CHUỖI -You will often need to change the contents of a string. +Đôi khi bạn sẽ cần phải thay đổi nội dung của một chuỗi. -Strings have built-in functionality that allow you to inspect and manipulate their contents. +Strings Object đã xây dựng sẵn một số chức năng mà cho phép bạn kiểm tra và sử lý nội dung của nó. -Here is an example using the `.replace()` method: +Dưới đây là một ví dụ sử dụng phương thức `.replace()`: ```js var example = 'this example exists'; @@ -14,22 +14,22 @@ example = example.replace('exists', 'is awesome'); console.log(example); ``` -Note that to change the value that the `example` variable references, we need -to use the equals sign again, this time with the `example.replace()` method to -the right of the equals sign. +Chú ý rằng, để thay đổi giá trị mà biến `example` tham chiếu đến, chúng ta cần__ +phải sử dụng dấu bằng một lần nữa, lần này là gán với phương thức `example.replace()` ở__ +bên phải dấu bằng. -## The challenge: +## Thử thách: -Create a file named `revising-strings.js`. +Tạo một tệp tin là `revising-strings.js`. -Define a variable named `pizza` that references this string: `pizza is alright`. +Khởi tạo một biến là `pizza` mà tham chiếu đến giá trị: `pizza is alright` -Use the `.replace()` method to change `alright` to `wonderful`. +Sử dụng method `.replace()` để thay đổi từ `alright` sang `wonderful`. -Use `console.log()` to print the results of the `.replace()` method to the terminal. +Sử dụng `console.log()` để in kết quả của phương thức `.replace()` ra màn hình terminal. -Check to see if your program is correct by running this command: +Kiểm tra xem chương trình của bạn đã chạy đúng chưa bằng cách: -`javascripting verify revising-strings.js` +`javascripting-vi verify revising-strings.js` --- diff --git a/problems/revising-strings/solution.md b/problems/revising-strings/solution.md index 5aa91907..6d381d4d 100644 --- a/problems/revising-strings/solution.md +++ b/problems/revising-strings/solution.md @@ -1,11 +1,12 @@ --- # YES, PIZZA _IS_ WONDERFUL. +# VÂNG, PIZZA _is_ WONDERFUL. -Well done, with that `.replace()` method! +Làm tốt lắm, với phương thức `.replace()`! -Next we will explore **numbers**. +Tiếp theo, chúng ta sẽ khám phá **numbers**. -Run `javascripting` in the console to choose the next challenge. +Chạy `javascripting-vi` lệnh trên màn hình console để chọn thử thách tiếp theo. --- From 687bc93d19d6c201d9562c6e10a97c24d1b7a14c Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Sun, 19 Apr 2015 19:06:52 +0700 Subject: [PATCH 10/17] done 6, 7, 8 challenge --- problems/number-to-string/problem.md | 22 ++++++++++++---------- problems/number-to-string/solution.md | 8 ++++---- problems/numbers/problem.md | 18 +++++++++--------- problems/numbers/solution.md | 6 +++--- problems/rounding-numbers/problem.md | 27 +++++++++++++-------------- problems/rounding-numbers/solution.md | 8 ++++---- 6 files changed, 45 insertions(+), 44 deletions(-) diff --git a/problems/number-to-string/problem.md b/problems/number-to-string/problem.md index 03d819d9..cce5e2f6 100644 --- a/problems/number-to-string/problem.md +++ b/problems/number-to-string/problem.md @@ -1,28 +1,30 @@ --- -# NUMBER TO STRING +# CHUYỂN TỪ SỐ THÀNH CHUỖI -Sometimes you will need to turn a number into a string. +Đôi khi bạn sẽ cần chuyển một số thành một chuỗi. -In those instances you will use the `.toString()` method. Here's an example: +Trong những trường hợp như vậy bạn sẽ sử dụng phương thức `.toString()`. Đây là một ví dụ: ```js var n = 256; n = n.toString(); ``` -## The challenge +## Bài Tập: -Create a file named `number-to-string.js`. +Nhiệm vụ của bạn trong bài tập lần này là chuyển đổi một giá trị kiểu số sang kiểu chuỗi. -In that file define a variable named `n` that references the number `128`; +Đầu tiên, hãy tạo một tệp tin là `number-to-string.js`. -Call the `.toString()` method on the `n` variable. +Trong tệp tin đó hãy khai báo một biến `n` và gán nó với giá trị là `128`; -Use `console.log()` to print the results of the `.toString()` method to the terminal. +Sau đó, gọi phương thức `.toString()` với biến `n`. -Check to see if your program is correct by running this command: +Cuối cùng, bạn sử dụng `console.log()` để in kết quả của phương thức `.toString()` ra terminal. -`javascripting verify number-to-string.js` +Để kiểm tra xem chương trình của bạn đã chạy đúng hay chưa, hãy sử dụng lệnh: + +`javascripting-vi verify number-to-string.js` --- diff --git a/problems/number-to-string/solution.md b/problems/number-to-string/solution.md index da079ad0..eb017ab5 100644 --- a/problems/number-to-string/solution.md +++ b/problems/number-to-string/solution.md @@ -1,11 +1,11 @@ --- -# THAT NUMBER IS NOW A STRING! +# SỐ ĐÓ ĐÃ LÀ MỘT CHUỖI! -Excellent. Good work converting that number into a string. +Tuyệt vời. Bạn đã làm tốt công việc chuyển đổi một giá trị kiểu số sang kiểu chuỗi. -In the next challenge we will take a look at **if statements**. +Trong thử thách tiếp theo chúng ta sẽ làm việc với câu lệnh **if statments**. -Run `javascripting` in the console to choose the next challenge. +Chạy lệnh `javascripting-vi` trên màn hình console để chọn các thử thách tiếp theo. --- diff --git a/problems/numbers/problem.md b/problems/numbers/problem.md index 5f0ac33a..e95250f1 100644 --- a/problems/numbers/problem.md +++ b/problems/numbers/problem.md @@ -1,20 +1,20 @@ --- -# NUMBERS +# SỐ -Numbers can be integers, like `2`, `14`, or `4353`, or they can be decimals, -also known as floats, like `3.14`, `1.5`, or `100.7893423`. +Số (numbers) có thể là những số nguyên (intergers) như `2`, `14`, hay `1741`, hoặc chúng có thể là những số thập phân (decimals), còn được gọi là số thực (float), như `3.14`, `1.5` hay `100.6789`. -## The challenge: -Create a file named numbers.js. +## Nhiệm vụ: -In that file define a variable named `example` that references the integer `123456789`. +Tạo một tệp tin là `numbers.js`. -Use `console.log()` to print that number to the terminal. +Trong tệp tin đó bạn hãy khai báo một biến là `example` và gán cho nó một giá trị là số nguyên `123456789`. -Check to see if your program is correct by running this command: +Sử dụng `console.log()` để in số đó ra terminal. -`javascripting verify numbers.js` +Và đừng quên kiểm tra xem chương trình của bạn đã chạy đúng chưa bằng lệnh sau: + +`javascripting-vi verify numbers.js` --- diff --git a/problems/numbers/solution.md b/problems/numbers/solution.md index 3e990011..8a9c5e55 100644 --- a/problems/numbers/solution.md +++ b/problems/numbers/solution.md @@ -2,10 +2,10 @@ # YEAH! NUMBERS! -Cool, you successfully defined a variable as the number `123456789`. +Tốt lắm, bạn đã định nghĩa thành công một biến với giá trị là số nguyên `123456789`. -In the next challenge we will look at manipulating numbers. +Trong bài tập tiếp theo chúng ta sẽ thao tác với các con số nhiều hơn. -Run `javascripting` in the console to choose the next challenge. +Chạy `javascripting-vi` trên màn hình console để chọn các bài tập tiếp theo. --- diff --git a/problems/rounding-numbers/problem.md b/problems/rounding-numbers/problem.md index 58a5df1a..e3fb526d 100644 --- a/problems/rounding-numbers/problem.md +++ b/problems/rounding-numbers/problem.md @@ -1,33 +1,32 @@ --- -# ROUNDING NUMBERS +# LÀM TRÒN SỐ -We can do basic math using familiar operators like `+`, `-`, `*`, `/`, and `%`. +Chúng ta có thể làm các phép toán cơ bản với những toán tử quen thuộc như `+`, `-`, `*`, `/`, and `%`. -For more complex math, we can use the `Math` object. +Với những phép toán phức tạp hơn, chúng ta có thể sử dụng đối tượng `Math`. -In this challenge we'll use the `Math` object to round numbers. +Trong nhiệm vụ lần này, chúng ta sẽ sử dụng đối tượng `Math` để làm tròn số. -## The challenge: +## Bài tập: -Create a file named rounding-numbers.js. +Đầu tiên, các bạn hãy tạo một tệp tin là `rounding-numbers.js`. -In that file define a variable named `roundUp` that references the float `1.5`. +Trong tệp tin đó, hãy khai báo một biến là `roundUp` rồi gán nó bằng một số thực `1.5`. -We will use the `Math.round()` method to round the number up. +Chúng ta sẽ sử dụng phương thức `Math.round()` để làm tròn số lên. -An example of using `Math.round()`: +Một ví dụ sử dụng `Math.round()`: ```js Math.round(0.5); ``` +Khai báo một biến thứ hai là `rounded` rồi gán nó bằng đầu ra của phương thức `Math.round()`, với tham số là biến `roundUp`. -Define a second variable named `rounded` that references the output of the `Math.round()` method, passing in the `roundUp` variable as the argument. +Sử dụng `console.log()` để in số đó ra terminal. -Use `console.log()` to print that number to the terminal. +Và cuối cùng, đừng quên kiểm tra xem chương trình của bạn chạy đã đúng hay chưa bằng câu lệnh sau: -Check to see if your program is correct by running this command: - -`javascripting verify rounding-numbers.js` +`javascripting-vi verify rounding-numbers.js` --- diff --git a/problems/rounding-numbers/solution.md b/problems/rounding-numbers/solution.md index 10ea666a..4cc5df6e 100644 --- a/problems/rounding-numbers/solution.md +++ b/problems/rounding-numbers/solution.md @@ -1,11 +1,11 @@ --- -# THAT NUMBER IS ROUNDED +# SỐ ĐÓ ĐÃ ĐƯỢC LÀM TRÒN -Yep, you just rounded the number `1.5` to `2`. Good job. +Vâng, bạn chỉ làm tròn số `1.5` lên `2`. Làm tốt lắm. -In the next challenge we will turn a number into a string. +Trong thử thách lần tới, chúng ta sẽ tìm hiểu cách chuyển một số sang dạng chuỗi. -Run `javascripting` in the console to choose the next challenge. +Chạy lệnh `javascripting-vi` ở màn hình console của bạn để chọn các thử thách tiếp theo. --- From d9a09f58e4d6d77498a4ee08cc2708e10afe15ad Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 27 Apr 2015 16:44:48 +0700 Subject: [PATCH 11/17] update if statement chappter --- problems/if-statement/problem.md | 27 ++++++++++++++------------- problems/if-statement/solution.md | 6 +++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/problems/if-statement/problem.md b/problems/if-statement/problem.md index 44cd216d..d4ee33b4 100644 --- a/problems/if-statement/problem.md +++ b/problems/if-statement/problem.md @@ -1,10 +1,10 @@ --- -# IF STATEMENT +# CÂU LỆNH IF -Conditional statements are used to alter the control flow of a program, based on a specified boolean condition. +Câu điều kiện được sử dụng để làm thay đổi dòng điều khiển của một chương trình, dựa trên một giá trị boolean xác định. -A conditional statement looks like this: +Một câu lệnh điều kiện sẽ có dạng như sau: ```js if (n > 1) { @@ -14,23 +14,24 @@ if (n > 1) { } ``` -Inside parentheses you must enter a logic statement, meaning that the result of the statement is either true or false. +Bên trong dấu ngoặc đơn, bạn phải truyền vào một điều kiện logic (logic statement), điều đó có nghĩa nó chỉ có giá trị đúng hoặc sai. -The else block is optional and contains the code that will be executed if the statement is false. +Nếu điều kiện trong dấu ngoặc là sai, đoạn mã trong block else sẽ được thực thi. -## The challenge +## Bài tập: -Create a file named `if-statement.js`. +Đầu tiên, các bạn tạo một tệp tin tên là: `if-statement.js`. -In that file, declare a variable named `fruit`. +Trong tệp tin đó, khai báo một biến là: `fruit`. -Make the `fruit` variable reference the value **orange** with the type of **String**. +Khởi tạo biến `fruit` với giá trị **orange** với kiểu **String**. -Then use `console.log()` to print "**The fruit name has more than five characters."** if the length of the value of `fruit` is greater than five. -Otherwise, print "**The fruit name has five characters or less.**" +Sau đó sử dụng câu lệnh `console.log()` để in ra **"The fruit name has more than five characters."** nếu như độ dài của biến `fruit` là lớn hơn 5. -Check to see if your program is correct by running this command: +Nếu không, hãy in ra chuỗi: "**The fruit name has five characters or less.**" -`javascripting verify if-statement.js` +Kiểm tra xem chương trình của bạn chạy đúng hay chưa bằng lệnh: + +`javascripting-vi verify if-statement.js` --- diff --git a/problems/if-statement/solution.md b/problems/if-statement/solution.md index 68c72522..e3fb9edc 100644 --- a/problems/if-statement/solution.md +++ b/problems/if-statement/solution.md @@ -2,10 +2,10 @@ # CONDITIONAL MASTER -You got it! The string `orange` has more than five characters. +Bạn đã hiểu rồi đấy! Chuỗi `orange` có nhiều hơn 5 kí tự. -Get ready to take on **for loops** next! +Hãy sẵn sằng để bắt đầu sử dụng **for loops** trong thử thách tiếp theo! -Run `javascripting` in the console to choose the next challenge. +Đừng quên chạy lệnh `javascripting-vi` ở màn hình console để lựa chọn thử thách tiếp theo cho mình. --- From 057456848354d08d4d9b5e7daca8e38c784352b1 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Mon, 27 Apr 2015 16:45:05 +0700 Subject: [PATCH 12/17] update for loop chapter --- problems/for-loop/problem.md | 30 +++++++++++++++--------------- problems/for-loop/solution.md | 8 ++++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/problems/for-loop/problem.md b/problems/for-loop/problem.md index bb0ffac5..593ea458 100644 --- a/problems/for-loop/problem.md +++ b/problems/for-loop/problem.md @@ -1,8 +1,8 @@ --- -# FOR LOOPS +# Vòng lặp FOR -For loops look like this: +Vòng lặp for sẽ trông như thế này: ```js for (var i = 0; i < 10; i++) { @@ -11,33 +11,33 @@ for (var i = 0; i < 10; i++) { } ``` -The variable `i` is used to track how many times the loop has run. +Biến `i` là được sử dụng để theo dõi xem vòng lặp đã chạy được bao nhiêu lần. -The statement `i < 10;` indicates the limit of the loop. -It will continue to loop if `i` is less than `10`. +Câu lệnh `i < 10;` chỉ ra rằng giới hạn của vòng lặp. +Nó sẽ tiếp tục lặp nếu `i` vẫn còn nhỏ hơn `10`. -The statement `i++` increases the variable `i` by 1 each loop. +Câu lệnh `i++` để tăng giá trị `i` lên một sau mỗi vòng lặp. -## The challenge: +## Bài tập: -Create a file named for-loop.js. +Hãy tạo một tệp tin là `for-loop.js`. -In that file define a variable named `total` and make it equal the number `0`. +Trong tệp tin đó hạy tạo một biến là `total` và khởi tạo nó với giá trị bằng `0`. -Define a second variable named `limit` and make it equal the number `10`. +Định nghĩa một biến thứ hai là `limit` và khởi tạo nó với giá trị bằng `10`. -Create a for loop in 10 iterations. On each loop, add the number `i` to the `total` variable. +Tạo một vòng lặp bắt đầu với biến `i` bằng 0 và tăng lên 1 sau mỗi vòng lặp. Vòng lặp sẽ chạy chừng nào `i` còn nhỏ hơn `limit`. -You can use a statement like this one: +Trong mỗi bước lặp, hãy tăng giá trị của biến `total` lên một khoảng bằng giá trị `i`. Để làm điều này, bạn có thể sử dụng câu lệnh: ```js total += i; ``` -After the for loop, use `console.log()` to print the `total` variable to the terminal. +Sau vòng lặp for, hãy sử dụng câu lệnh `console.log()` để in ra giá trị của biến `total()` trên terminal.. -Check to see if your program is correct by running this command: +Kiểm tra xem chương trình của bạn đã chạy đúng chưa bằng các sử dụng câu lệnh: -`javascripting verify for-loop.js` +`javascripting-vi verify for-loop.js` --- diff --git a/problems/for-loop/solution.md b/problems/for-loop/solution.md index b9429ce7..3a920555 100644 --- a/problems/for-loop/solution.md +++ b/problems/for-loop/solution.md @@ -1,11 +1,11 @@ --- -# THE TOTAL IS 45 +# Giá trị của biến `total` là 45. -That is a basic introduction to for loops, which are handy in a number of situations, particularly in combination with other data types like strings and arrays. +Đây lfa sự giới thiệu cơ bản về vòng lặp for, nó sẽ có ích trong một số tình huống, đặc biệt là trong sự kết hợp với các kiểu dữ liệu khác như String hay Array. -In the next challenge we'll start working with **arrays**. +Trong thử thách tiếp theo, chúng ta sẽ bắt đầu làm việc với **arrays**. -Run `javascripting` in the console to choose the next challenge. +Hãy chạy lênh `javascripting-vi` trên màn hình console để lựa chọn. --- From c8049854a8d47f0c3123fe69ba477c38a8e4563b Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Tue, 28 Apr 2015 00:06:57 +0700 Subject: [PATCH 13/17] fixed translating for loop chapter --- problems/for-loop/problem.md | 6 +++--- problems/for-loop/solution.md | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/problems/for-loop/problem.md b/problems/for-loop/problem.md index 593ea458..accdccba 100644 --- a/problems/for-loop/problem.md +++ b/problems/for-loop/problem.md @@ -16,9 +16,9 @@ Biến `i` là được sử dụng để theo dõi xem vòng lặp đã chạy Câu lệnh `i < 10;` chỉ ra rằng giới hạn của vòng lặp. Nó sẽ tiếp tục lặp nếu `i` vẫn còn nhỏ hơn `10`. -Câu lệnh `i++` để tăng giá trị `i` lên một sau mỗi vòng lặp. +Câu lệnh `i++` để tăng giá trị `i` lên 1 đơn vị sau mỗi vòng lặp. -## Bài tập: +## Nhiệm vụ: Hãy tạo một tệp tin là `for-loop.js`. @@ -34,7 +34,7 @@ Trong mỗi bước lặp, hãy tăng giá trị của biến `total` lên một total += i; ``` -Sau vòng lặp for, hãy sử dụng câu lệnh `console.log()` để in ra giá trị của biến `total()` trên terminal.. +Sau vòng lặp for, hãy sử dụng câu lệnh `console.log()` để in ra giá trị của biến `total()` trên terminal. Kiểm tra xem chương trình của bạn đã chạy đúng chưa bằng các sử dụng câu lệnh: diff --git a/problems/for-loop/solution.md b/problems/for-loop/solution.md index 3a920555..42d49fc6 100644 --- a/problems/for-loop/solution.md +++ b/problems/for-loop/solution.md @@ -2,10 +2,11 @@ # Giá trị của biến `total` là 45. -Đây lfa sự giới thiệu cơ bản về vòng lặp for, nó sẽ có ích trong một số tình huống, đặc biệt là trong sự kết hợp với các kiểu dữ liệu khác như String hay Array. +Bài này chỉ giới thiệu cơ bản về vòng lặp for, nhưng nó sẽ có rất ích trong một số tình huống, đặc biệt là khi xử lý dữ liệu mảng(Array) hoặc xâu chuỗi (String). -Trong thử thách tiếp theo, chúng ta sẽ bắt đầu làm việc với **arrays**. -Hãy chạy lênh `javascripting-vi` trên màn hình console để lựa chọn. +Trong bài tập tiếp theo, chúng ta sẽ bắt đầu làm việc với **arrays**. + +Hãy chạy lênh `javascripting` trên màn hình console để lựa chọn. --- From c3f639cfea18feadd4931707119537803f702380 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Tue, 28 Apr 2015 00:10:37 +0700 Subject: [PATCH 14/17] fixing some translating if statement chapter --- problems/if-statement/problem.md | 4 ++-- problems/if-statement/solution.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/if-statement/problem.md b/problems/if-statement/problem.md index d4ee33b4..1db42042 100644 --- a/problems/if-statement/problem.md +++ b/problems/if-statement/problem.md @@ -18,7 +18,7 @@ Bên trong dấu ngoặc đơn, bạn phải truyền vào một điều kiện Nếu điều kiện trong dấu ngoặc là sai, đoạn mã trong block else sẽ được thực thi. -## Bài tập: +## Nhiệm vụ: Đầu tiên, các bạn tạo một tệp tin tên là: `if-statement.js`. @@ -32,6 +32,6 @@ Nếu không, hãy in ra chuỗi: "**The fruit name has five characters or less. Kiểm tra xem chương trình của bạn chạy đúng hay chưa bằng lệnh: -`javascripting-vi verify if-statement.js` +`javascripting verify if-statement.js` --- diff --git a/problems/if-statement/solution.md b/problems/if-statement/solution.md index e3fb9edc..ebf27bce 100644 --- a/problems/if-statement/solution.md +++ b/problems/if-statement/solution.md @@ -6,6 +6,6 @@ Bạn đã hiểu rồi đấy! Chuỗi `orange` có nhiều hơn 5 kí tự. Hãy sẵn sằng để bắt đầu sử dụng **for loops** trong thử thách tiếp theo! -Đừng quên chạy lệnh `javascripting-vi` ở màn hình console để lựa chọn thử thách tiếp theo cho mình. +Đừng quên chạy lệnh `javascripting` ở màn hình console để lựa chọn thử thách tiếp theo cho mình. --- From e706fc1ee81135fd14cb05425c0d804cea1144da Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Tue, 28 Apr 2015 00:10:59 +0700 Subject: [PATCH 15/17] update translating for loop chapter --- problems/for-loop/problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/for-loop/problem.md b/problems/for-loop/problem.md index accdccba..fcb020b6 100644 --- a/problems/for-loop/problem.md +++ b/problems/for-loop/problem.md @@ -38,6 +38,6 @@ Sau vòng lặp for, hãy sử dụng câu lệnh `console.log()` để in ra gi Kiểm tra xem chương trình của bạn đã chạy đúng chưa bằng các sử dụng câu lệnh: -`javascripting-vi verify for-loop.js` +`javascripting verify for-loop.js` --- From 9d9fce9c41d9e89bdf4d467ec90ba4daee37f6b8 Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Tue, 28 Apr 2015 00:17:52 +0700 Subject: [PATCH 16/17] update readme --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 752e7428..7659f0fe 100644 --- a/readme.md +++ b/readme.md @@ -13,12 +13,12 @@ Hãy chắc chắn rằng Node.js là đã được cài đặt trên máy của Cài đặt nó từ [nodejs.org/download](http://nodejs.org/download) -### Cài đặt `javascripting-vi` với `npm` +### Cài đặt `javascripting` với `npm` Hãy mở terminal của bạn và chạy câu lệnh sau: ``` -npm install --global javascripting-vi +npm install --global javascripting ``` Tùy chọn `--global` hay `-g` sẽ cài đặt module này trên toàn hệ điều hành của bạn, tức là bạn có thể chạy nó như một command trên terminal của mình. @@ -28,7 +28,7 @@ Tùy chọn `--global` hay `-g` sẽ cài đặt module này trên toàn hệ đ Hãy mở terminal của mình lên và chạy: ``` -js-vi +javascripting ``` Bạn sẽ thấy: From eb6964f6f077ee1adfddbe243b3c73bfdf56913e Mon Sep 17 00:00:00 2001 From: NgaNguyenDuy Date: Fri, 4 Dec 2015 21:59:53 +0100 Subject: [PATCH 17/17] updated vietnamese translation --- problems/introduction/problem_vi.md | 43 ++++++++++++++++++++++++++++ problems/introduction/solution_vi.md | 21 ++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 problems/introduction/problem_vi.md create mode 100644 problems/introduction/solution_vi.md diff --git a/problems/introduction/problem_vi.md b/problems/introduction/problem_vi.md new file mode 100644 index 00000000..c71b5a7d --- /dev/null +++ b/problems/introduction/problem_vi.md @@ -0,0 +1,43 @@ +Để giữ những đoạn mã của bạn một cách có tổ chức, hãy tạo một thư mục cho +workshop này. + +Hãy chạy câu lệnh sau để tạo một thư mục tên là `javascripting` (hoặc cái gì +khác nếu bạn thích): + + +```bash +mkdir javascripting +``` + +Di chuyển vào trong thư mục `javascripting`: + +```bash +cd javascripting +``` + +Hãy tạo một tệp tin và đặt tên là `introduction.js`: + +```bash +touch introduction.js +``` + +hoặc nếu như bạn đang dùng windows, +```bash +type NUL > introduction.js +``` + +Hãy mở tệp tin đó bằng trình soạn thảo văn bản yêu thích của bạn và thêm đoạn +mã sau: + + +```js +console.log('hello'); +``` + +Lưu tệp tin lại. Để kiểm tra xem chương trình của bạn có chạy đúng hay không, +hãy chạy lệnh sau: + + +```bash +javascripting verify introduction.js +``` diff --git a/problems/introduction/solution_vi.md b/problems/introduction/solution_vi.md new file mode 100644 index 00000000..ca274afc --- /dev/null +++ b/problems/introduction/solution_vi.md @@ -0,0 +1,21 @@ +--- + +# BẠN LÀM ĐƯỢC RỒI! + + +Bất cứ điều gì ở giữa cặp ngoặc của câu lệnh `console.log()` là được in ra +terminal. + +Vậy nên: + +```js +console.log('hello'); +``` + +sẽ in dòng `hello` ra terminal. + +**string** `hello` đã được in ra trên terminal của bạn. + +Trong phần tiếp theo chúng ta sẽ tìm hiểu về **variables** trong javascript. + +Hãy chạy lệnh `javascripting` để lựa chọn thử thách tiếp theo.