Skip to content

Commit

Permalink
refactor(curriculum): update RPG project to accommodate new intro pyr…
Browse files Browse the repository at this point in the history
…amid project (#54435)

Co-authored-by: Sem Bauke <semboot699@gmail.com>
  • Loading branch information
jdwilkin4 and Sembauke committed Apr 22, 2024
1 parent ec11a4b commit eed5575
Show file tree
Hide file tree
Showing 178 changed files with 624 additions and 2,044 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dashedName: step-1

JavaScript is a powerful language which allows you to build websites that are interactive.

*Note*: For all of the projects in this curriculum, you will need to have a basic level knowledge of HTML and CSS. If you are new to HTML and CSS, please go through the [Responsive Web Design Certification](https://www.freecodecamp.org/learn/2022/responsive-web-design/) first.
*Note*: For all remaining projects in this curriculum, you will need a basic level of knowledge in HTML and CSS. If you are new to HTML and CSS, please go through the [Responsive Web Design Certification](https://www.freecodecamp.org/learn/2022/responsive-web-design/).

To get started, create your standard HTML boilerplate with a `DOCTYPE`, `html`, `head`, and `body`, then add a `meta` tag for the `charset`. Add a `title` element and use the text `RPG - Dragon Repeller` for it. Include a `link` tag for your stylesheet to link the `styles.css` file.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a115879a6d51422652cbfc
title: Step 15
title: Step 11
challengeType: 0
dashedName: step-15
dashedName: step-11
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a1166ed9a56d439c0770e7
title: Step 16
title: Step 12
challengeType: 0
dashedName: step-16
dashedName: step-12
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a23c1d505bfa13747c8a9b
title: Step 17
title: Step 13
challengeType: 0
dashedName: step-17
dashedName: step-13
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a23cb9bc467a147516b500
title: Step 18
title: Step 14
challengeType: 0
dashedName: step-18
dashedName: step-14
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a23d1c5f1c93161f3582ae
title: Step 23
title: Step 19
challengeType: 0
dashedName: step-23
dashedName: step-19
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a2401b9842721796b72850
title: Step 24
title: Step 20
challengeType: 0
dashedName: step-24
dashedName: step-20
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a24068d60b671847d1d4e2
title: Step 25
title: Step 21
challengeType: 0
dashedName: step-25
dashedName: step-21
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a2409897ec621942234cf6
title: Step 26
title: Step 22
challengeType: 0
dashedName: step-26
dashedName: step-22
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a240c67f3dbb1a1e6d95ee
title: Step 27
title: Step 23
challengeType: 0
dashedName: step-27
dashedName: step-23
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a24128d5e8af1b47ad1aab
title: Step 28
title: Step 24
challengeType: 0
dashedName: step-28
dashedName: step-24
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a24190868ca51c0b6e83c7
title: Step 30
title: Step 26
challengeType: 0
dashedName: step-30
dashedName: step-26
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a241df03c1f61ce936f5d9
title: Step 31
title: Step 27
challengeType: 0
dashedName: step-31
dashedName: step-27
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ dashedName: step-2

# --description--

Now you can start writing your JavaScript. Begin by creating a `script` element. This element is used to load JavaScript into your HTML file. You should use an opening `<script>` and closing `</script>` tag.
Now you can start writing your JavaScript. Begin by creating a `script` element. This element is used to load JavaScript into your HTML file.

```html
<script>
// JavaScript code goes here
</script>
```

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ The developer console will include errors that are produced by your code, but yo

Add a `console.log("Hello World");` line between your `script` tags. Then click the "Console" button to open the console. You should see the text `"Hello World"`.

Note how the line ends with a semi-colon. It is common practice in JavaScript to end your code lines with semi-colons.

# --hints--

You should add a `console.log("Hello World");` line to your code. Don't forget the semi-colon.
You should add a `console.log("Hello World");` line to your code.

```js
assert.match(code, /console\.log\(\s*('|")Hello World\1\s*\)\s*;/);
assert.match(code, /console\.log\(\s*('|")Hello World\1\s*\)\s*;?/);
```

Your `console.log("Hello World");` line should be between your `script` tags.

```js
assert.match(code, /<script\s*>\s*console\.log\(\s*('|")Hello World\1\s*\)\s*;\s*<\/script>/);
assert.match(code, /<script\s*>\s*console\.log\(\s*('|")Hello World\1\s*\)\s*;?\s*<\/script>/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ dashedName: step-6

Remove your `console.log("Hello World");` line to begin writing your project code.

In JavaScript, a <dfn>variable</dfn> is used to hold a value. To use a variable, you must first <dfn>declare</dfn> it. For example, to declare a variable called `camperbot`, you would write:
In the previous project, you learned how to work with variables and the `let` keyword like this:

```js
let camperbot;
```

The `let` keyword tells JavaScript you are declaring a variable. Declare a variable called `xp`.
You also learned how to initialize a variable with a value like this:

```js
let age = 32;
```

Use the `let` keyword to declare a variable called `xp` and assign it the value of `0`, a number.

# --hints--

Expand All @@ -37,18 +43,19 @@ You should declare a variable named `xp`.
assert.match(code, /let\s+xp/);
```

You should not assign a value to your variable.
`xp` should have a value of `0`.

```js
assert.notMatch(code, /let\s+xp\s*=/);
assert.equal(xp, 0);
```

Don't forget the semi-colon at the end of the line.
You should initialize the `xp` variable to `0`.

```js
assert.match(code, /let\s+xp\s*;/);
assert.match(code, /let\s+xp\s*=\s*0\s*;?/)
```


# --seed--

## --seed-contents--
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: 62a3a75d8466a12e009eff76
title: Step 8
title: Step 7
challengeType: 0
dashedName: step-8
dashedName: step-7
---

# --description--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
---
id: 62a3a7e4f1060e2fc5ffb34b
title: Step 9
title: Step 8
challengeType: 0
dashedName: step-9
dashedName: step-8
---

# --description--

Create another variable called `currentWeapon` and set it to `0`.

When a variable name has multiple words, the convention in JavaScript is to use what's called <dfn>camelCase</dfn>. The first word is lowercase, and the first letter of every following word is uppercase.

```js
let thisIsCamelCase;
```

# --hints--

You should use `let` to declare a variable called `currentWeapon`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: 62a3b3eab50e193608c19fc6
title: Step 10
title: Step 9
challengeType: 0
dashedName: step-10
dashedName: step-9
---

# --description--

Declare a variable called `fighting` but do not initialize it with a value. Remember to end your line with a semi-colon.
Declare a variable called `fighting` but do not initialize it with a value.

# --hints--

Expand All @@ -23,10 +23,10 @@ Your `fighting` variable should not have a value.
assert.isUndefined(fighting);
```

You should not assign a value to your `fighting` variable. Don't forget the semi-colon at the end of the line.
You should not assign a value to your `fighting` variable.

```js
assert.match(code, /let\s+fighting\s*;/);
assert.match(code, /let\s+fighting\s*;?/);
```

# --seed--
Expand Down

0 comments on commit eed5575

Please sign in to comment.