master
Thom Page 10 years ago
parent e1129f9075
commit 57ebf15abc

File diff suppressed because it is too large Load Diff

@ -0,0 +1,199 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: Pokedex <br>
Type: Homework<br>
Duration: Weekend <br>
Creator: Thom Page <br>
Course: WDIr-Panthalassa<br>
---
# Make a POKEDEX
![](http://2.bp.blogspot.com/_-wYnCaxCjpQ/TLzx5cAvEGI/AAAAAAAACfw/_RCnrFIP7LM/s1600/poke2.jpg)
## App: Full CRUD and REST
Your mission is to make a Pokémon character manager (a Pokédex).
All you are given is a `pokemon.js` file that has all the raw data for 151 Pokémon. Don't click on or open this file unless you are prepared to wait a minute or so for it to load. It is a huge file.
**It is up to you how you build your app**, in what order you want to do things, what kind of design flow your app will have, where you put your delete button, etc, and what parts of the Pokémon data your pages will display.
There are a few requirement to keep in mind.
The app will:
- display a bunch of Pokémon images on the index
- have separate show pages for each Pokémon
- have the ability to add a new Pokémon
- have the ability to edit existing Pokémon
- have the ability to delete Pokémon
The app will use RESTful routing:
- Index
- GET `/pokemon`
- Show
- GET `/pokemon/:id`
- New
- GET `/pokemon/new`
- Edit
- GET `/pokemon/:id/edit`
- Create
- POST `/pokemon`
- Update
- PUT `/pokemon/:id`
- Destroy
- DELETE `/pokemon/:id`
(Note that these URIs will be abbreviated when setting middleware to use the `/pokemon` route in conjunction with `express.Router()`)
## MVC
Ideally, your app should follow the MVC format of *models*, *views*, and *controllers*.
You will want a folder each for Models, Views, and Controllers.
![](http://i.imgur.com/TKXEFA5.png)
To separate your Controllers from `server.js`, use `express.Router()`:
```
// server.js
var pokemonController = require('./controllers/pokemonController.js');
app.use('/pokemon', pokemonController);
```
```
// pokemonController.js
var express = require('express'),
router = express.Router(),
Pokemon = require('../models/pokemon.js');
// INDEX
router.get('/', function(req, res) {
res.render('index.ejs', { data: Pokemon });
});
// SHOW
router.get('/:id', function(req, res) {
res.render('show.ejs', { data: Pokemon[req.params.id] });
});
module.exports = router;
```
### Use static assets
Make your app look and act nicely with static assets-- try using jQuery.
### Notes on the Pokémon data and what to display
The `pokemon.js` file is massive and there is a ton of data to parse through. You need not display all of it on your pages. On your index page, you can just render the images.
Here are suggestions for what to display on your Pokémon's show page:
- The pokemon's name
- The image of the pokemon
- An unordered list of the Pokemon's types (eg. water, poison, etc).
- The pokemon's stats for HP, ATTACK, and DEFENSE.
### Notes on testing
Sometimes you don't want to have to build out a view or a form in order to test if a POST, PUT, or DELETE route is working. Use Postman or cURL on these routes and console.log a message and/or req.body to see if the route is working, and worry about the view later.
### Commits
The order of your commits this time does not matter, but the app is complete with six particular commits. When you have completed the following, make your commits as follows, and include the number of your commit:
Examples:
<hr>
** Commit your work.** <br>
"Displays a bunch of Pokémon images on the index".
<hr>
<hr>
** Commit your work.** <br>
"Has separate show pages for each Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to add a new Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to edit existing Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to delete Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"The app uses RESTful routing, all seven RESTful routes".
<hr>
<hr>
** Commit your work.** <br>
"The app uses the MVC pattern established with views and models".
<hr>
<hr>
** Commit your work.** <br>
"The app uses the MVC pattern established with express.Router()".
<hr>
<hr>
** Commit your work.** <br>
"View templates are complete".
<hr>
<hr>
** Commit your work.** <br>
"Static assets included - CSS".
<hr>
<hr>
** Commit your work.** <br>
"Static assets included - jQuery".
<hr>
### INVESTIGATION
If you get everything done, make a copy of your pokedex homework. Look into using the mongodb node package with express within your copy:
https://www.npmjs.com/package/mongodb
Try to connect your app to a mongo db. Investigate how you can do Read operations, and then how to do Create operations inside the controller in your app. You might want to seed your Mongo db with select Pokémon data.
Note that this is advanced, and is not how we will be doing Mongo queries inside our app in the future. Instead, we will be using a node package called Mongoose which uses different commands.
Nevertheless, it is worth your time to investigate how to get mongo connected to your app, and how to make raw mongo queries within it, even if you get absolutely nowhere with it.

@ -0,0 +1,136 @@
{
name: 'Count Chocula',
hair_color: 'brown',
eye_color: 'brown',
dob: new Date(1971, 2, 13, 7, 47),
loves: ['cereal','marshmallows'],
location: 'Minneapolis, Minnesota, US',
gender: 'm',
victims: 2
},{
name: 'Dracula',
dob: new Date(937, 0, 24, 13, 0),
hair_color: 'brown',
eye_color: 'blue',
loves: ['Winona Ryder', 'top hats', 'fancy cloaks', 'handlebar mustaches'],
location: 'Transylvania, Romania',
gender: 'm',
victims: 1238
},{
name: 'Elizabeth Bathory ',
dob: new Date(1560, 8, 7, 22, 10),
hair_color: 'brown',
eye_color: 'brown',
loves: ['virgin blood', 'fancy cloaks','frilly collars'],
location: 'Nyírbátor, Hungary',
gender: 'f',
victims: 980
},{
name: 'Lestat',
dob: new Date(1760, 11, 9, 18, 44),
hair_color: 'blonde',
eye_color: 'blue',
loves: ['frilly shirtsleeves', 'frilly collars', 'lurking in rotting mansions', 'Louis'],
location: 'Auvergne, France',
gender: 'm',
victims: 324
},{
name: 'Louis de Pointe du Lac',
dob: new Date(1766, 6, 4, 2, 1),
hair_color: 'brown',
eye_color: 'blue',
loves:['brooding', 'Claudia', 'staring longingly into the distance'],
location: 'New Orleans, Louisiana, US',
gender:'m',
victims: 150
},{
name:'Claudia',
dob: new Date(1793, 2, 7, 8, 30),
hair_color: 'blonde',
eye_color: 'blue',
loves: ['doll babies', 'ribbons', 'appearing innocent', ' trickery'],
location: 'New Orleans, Louisiana, US',
gender: 'f',
victims: 290
},{
name:'Armand',
dob: new Date(1481, 6, 1, 10, 42),
hair_color: 'red',
eye_color: 'brown',
loves: ['theatre', 'painting', 'velvet robes', 'being tragic'],
location: 'Kiev, Russia',
gender: 'm',
victims: 1045
},{
name:'Santino',
dob: new Date(1465, 6, 1, 10, 42),
hair_color: 'brown',
eye_color: 'brown',
loves: ['trickery', 'vampiric cults', 'fancy cloaks'],
location: 'Rome, Italy',
gender: 'm',
victims: 1103
},{
name:'Akasha',
dob: new Date(-8000, 6, 1, 10, 42),
hair_color: 'brown',
eye_color: 'green',
loves: ['eating hearts', 'bathing in roses', 'elaborate headdresses', 'R&B music'],
location: 'Kemet, Egypt',
gender: 'f',
victims: 210234,
title: 'Queen of the Damned'
},{
name: 'Edward Cullen',
dob: new Date(1901, 6, 20, 0, 57),
hair_color: 'brown',
eye_color: 'brown',
loves: ['brooding', 'diamond skin', 'calling people spider monkeys'],
location: 'Chicago, Illinois, US',
gender: 'm',
},{
name: 'Persephone Bourignon',
dob: new Date(1801, 5, 17, 14, 53),
hair_color: 'red',
eye_color: 'green',
loves: ['wine', 'fancy cloaks', 'appearing innocent'],
location: 'Paris, France',
gender: 'f',
victims: 450
},{
name: 'René Tremblay',
dob: new Date(1922, 2, 8, 5, 3),
hair_color: 'brown',
eye_color: 'green',
loves: ['frilly shirtsleeves', 'trickery', 'card games'],
location: 'Bucharest, Romania',
gender: 'm',
victims: 134
},{
name: 'Caroline Belmont',
hair_color: 'blonde',
eye_color: 'brown',
dob: new Date(1799, 4, 21, 16, 15),
loves: ['marshmallows', 'ribbons', 'being tragic'],
location: 'Ljubljana, Slovenia',
gender: 'f',
victims: 567
},{
name: 'Francis Frost',
hair_color: 'black',
eye_color: 'blue',
dob: new Date(1976, 6, 18, 18, 18),
loves: ['brooding', 'frilly shirtsleeves'],
location: 'New York, New York, US',
gender: 'm',
victims: 112
},{
name: 'Barnabas Spenser',
hair_color: 'brown',
eye_color: 'brown',
dob: new Date(1984, 6, 3, 13, 12),
loves: ['being merry', 'being insane', 'card games'],
location: 'New York, New York, US',
gender: 'm',
title: 'Osiris of Sewer Rats'
}

@ -0,0 +1,204 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: Vampires - Raw Mongo Queries<br>
Type: Homework<br>
Duration: single night<br>
Adapted by: Thom Page <br>
Course: WDIr-Panthalassa<br>
---
# Vampires!
![Interview with the Vampire](https://mischiefmanagedsite.files.wordpress.com/2014/05/3.gif)
### Setup
1. Start `mongod`
2. Open your mongo console with `mongo`. Note: This homework is done in the terminal, there is no Express.
3. Connect to a new database called `monsters` with `use monsters`
4. Using the js objects of vampires in `populateVampires.js`, add the vampires to a `vampires` collection. Hint: you can use the **Adding Losts of New Documents** syntax from the example at the bottom of this document.
### Resources
#### Utilize the following resources to research the commands you will need
[https://docs.mongodb.org/manual/reference/operator/query/#query-selectors]
[http://mongoosejs.com/]
## MONGO SELECTION COMMANDS
For the following parts, write mongo queries in your CLI, and when you figure out the right answer, copy the correct mongo queries into a `selectVampires.md` file in your homework folder.
### Part 1
#### Select by comparison
Select all the vampires that:
- have greater than 500 victims
- have fewer than or equal to 150 victims
- have a victim count is not equal to 210234
- have greater than 150 AND fewer than 500 victims
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 1: Select by comparison".
<hr>
### Part 2
#### Select by exists or does not exist
Select all the vampires that:
- have a title property
- do not have a victims property
- have a title AND no victims
- have victims AND the victims they have are greater than 1000
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 2: Select by exists".
<hr>
### Part 3
#### Select objects that match one of several values
Select all the vampires that:
- love either `frilly shirtsleeves` or `frilly collars`
- love `brooding`
- love at least one of the following: `appearing innocent`, `trickery`, `lurking in rotting mansions`, `R&B music`
- love `fancy cloaks` but not if they also love either `top hats` or `virgin blood`
\* *Hint-You will also have to use $nin* \*
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 3: Select matching objects".
<hr>
### Part 4
#### Select with OR
Select all the vampires that:
- are from `New York, New York, US` or `New Orleans, Louisiana, US`
- love `brooding` or `being tragic`
- have more than 1000 victims or love `marshmallows`
- have red hair or green eyes
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 4: Select with OR".
<hr>
### Part 5
#### Negative Selection
Select all vampires that:
- love `ribbons` but do not have blonde hair
- are not from Rome
- do not love any of the following:
[`fancy cloaks`, `frilly shirtsleeves`, `appearing innocent`, `being tragic`, `brooding`]
- have not killed more than 200 people
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 5: Negative selection".
<hr>
### Part 6
#### Replacing a record
Replace the following:
- replace the vampire called 'Claudia' with a vampire called 'Eve'. 'Eve' will have a key called 'portrayed_by' with the value 'Tilda Swinton'
- replace the first male vampire with another whose name is 'Guy Man', and who has a key 'is_actually' with the value 'were-lizard'
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 6: Replacing a record".
<hr>
### Part 7
#### Update single values
Update the following:
- Update 'Guy Man' to have a gender of 'm'
- Update 'Eve' to have a gender of 'f'
- Update 'Guy Man' to have an array called 'hates' that includes 'clothes' and 'jobs'
- Update 'Guy Man's' hates array also to include 'alarm clocks' and 'jackalopes'
- Rename 'Eve's' name field to 'moniker'
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 7: Replacing a record".
<hr>
### Part 8
#### Remove documents
https://docs.mongodb.org/manual/tutorial/remove-documents/
- Remove a single document wherein the hair_color is 'brown'
- Remove all documents wheren the eye-color is 'green'
<hr>
** Commit your work.** <br>
The commit message should read: <br>
"Commit 8: Remove documents".
<hr>
#### Adding Lots of New Documents in plain Mongo
Pretend we have a collection called `people` and want to add lots of documents, we can simply provide this __array__ to the _insert_ method and it will create a document for each object in the array.
```
[
{
"name": "Emma",
"age": 20
},
{
"name": "Ray",
"age": 45
},
{
"name": "Celeste",
"age": 33
},
{
"name": "Stacy",
"age": 53
},
{
"name": "Katie",
"age": 12
},
{
"name": "Adrian",
"age": 47
}
]
```
> Note: Be sure to type the closing parenthesis of the _insert_ method!
`db.people.insert([array])`

File diff suppressed because it is too large Load Diff

@ -0,0 +1,200 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: Pokedex <br>
Type: Homework<br>
Duration: Weekend <br>
Creator: Thom Page <br>
Course: WDIr-Panthalassa<br>
---
# Make a POKEDEX
![](http://2.bp.blogspot.com/_-wYnCaxCjpQ/TLzx5cAvEGI/AAAAAAAACfw/_RCnrFIP7LM/s1600/poke2.jpg)
## App: Full CRUD and REST
Your mission is to make a Pokémon character manager (a Pokédex).
All you are given is a `pokemon.js` file that has all the raw data for 151 Pokémon. Don't click on or open this file unless you are prepared to wait a minute or so for it to load. It is a huge file.
**It is up to you how you build your app**, in what order you want to do things, what kind of design flow your app will have, where you put your delete button, etc, and what parts of the Pokémon data your pages will display.
There are a few requirement to keep in mind.
The app will:
- display a bunch of Pokémon images on the index
- have separate show pages for each Pokémon
- have the ability to add a new Pokémon
- have the ability to edit existing Pokémon
- have the ability to delete Pokémon
The app will use RESTful routing:
- Index
- GET `/pokemon`
- Show
- GET `/pokemon/:id`
- New
- GET `/pokemon/new`
- Edit
- GET `/pokemon/:id/edit`
- Create
- POST `/pokemon`
- Update
- PUT `/pokemon/:id`
- Destroy
- DELETE `/pokemon/:id`
(Note that these URIs will be abbreviated when setting middleware to use the `/pokemon` route in conjunction with `express.Router()`)
## MVC
Ideally, your app should follow the MVC format of *models*, *views*, and *controllers*.
You will want a folder each for Models, Views, and Controllers.
![](http://i.imgur.com/TKXEFA5.png)
To separate your Controllers from `server.js`, use `express.Router()`:
```
// server.js
var pokemonController = require('./controllers/pokemonController.js');
app.use('/pokemon', pokemonController);
```
```
// pokemonController.js
var express = require('express'),
router = express.Router(),
Pokemon = require('../models/pokemon.js');
// INDEX
router.get('/', function(req, res) {
res.render('index.ejs', { data: Pokemon });
});
// SHOW
router.get('/:id', function(req, res) {
res.render('show.ejs', { data: Pokemon[req.params.id] });
});
module.exports = router;
```
### Use static assets
Make your app look and act nicely with static assets-- try using jQuery.
### Notes on the Pokémon data and what to display
The `pokemon.js` file is massive and there is a ton of data to parse through. You need not display all of it on your pages. On your index page, you can just render the images.
Here are suggestions for what to display on your Pokémon's show page:
- The pokemon's name
- The image of the pokemon
- An unordered list of the Pokemon's types (eg. water, poison, etc).
- The pokemon's stats for HP, ATTACK, and DEFENSE.
### Notes on testing
Sometimes you don't want to have to build out a view or a form in order to test if a POST, PUT, or DELETE route is working. Use Postman or cURL on these routes and console.log a message and/or req.body to see if the route is working, and worry about the view later.
### Commits
The order of your commits this time does not matter, but the app is complete with six particular commits. When you have completed the following, make your commits as follows, and include the number of your commit:
Examples:
<hr>
** Commit your work.** <br>
"Displays a bunch of Pokémon images on the index".
<hr>
<hr>
** Commit your work.** <br>
"Has separate show pages for each Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to add a new Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to edit existing Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"Has the ability to delete Pokémon".
<hr>
<hr>
** Commit your work.** <br>
"The app uses RESTful routing, all seven RESTful routes".
<hr>
<hr>
** Commit your work.** <br>
"The app uses the MVC pattern established with views and models".
<hr>
<hr>
** Commit your work.** <br>
"The app uses the MVC pattern established with express.Router()".
<hr>
<hr>
** Commit your work.** <br>
"View templates are complete".
<hr>
<hr>
** Commit your work.** <br>
"Static assets included - CSS".
<hr>
<hr>
** Commit your work.** <br>
"Static assets included - jQuery".
<hr>
### INVESTIGATION
If you get everything done, make a copy of your pokedex homework. Look into using the mongodb node package with express within your copy:
https://www.npmjs.com/package/mongodb
Try to connect your app to a mongo db. Investigate how you can do Read operations, and then how to do Create operations inside the controller in your app. You might want to seed your Mongo db with select Pokémon data.
Note that this is advanced, and is not how we will be doing Mongo queries inside our app in the future. Instead, we will be using a node package called Mongoose which uses different commands.
Nevertheless, it is worth your time to investigate how to get mongo connected to your app, and how to make raw mongo queries within it, even if you get absolutely nowhere with it.

@ -0,0 +1,38 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: 100 Goblins <br>
Type: Extended Morning Exercise <br>
Creator: Microsoft <br>
Adapted by: Thom Page <br>
Course: WDIr-Panthalassa<br>
Competencies: Nested loops
---
# 100 GOBLINS
There are 100 Goblins suffering from acid reflux, and you are a sadistic Goblin doctor with the cure. You want to torture the Goblins with a little game.
You line up all the Goblins and give each of them the cure in turn, all 100 Goblins.
But then you start from the beginning of the line and go over them a second time, removing the cure for every second Goblin, starting with the second Goblin.
Then you do it a third time for every third Goblin, starting at the third Goblin: if the Goblin you now administer was previously cured, they are now uncured, and if the Goblin was uncured, they are now cured. You do it a fourth time, and go to every fourth Goblin starting with the fourth. The fifth time, you go to every fifth Goblin starting with the fifth ....
After you have gone down the line of Goblins 100 times, which Goblins are cured at the end?
Hint: set up an array of goblins first using a datatype good for setting either *true* or *false*
values. It's certainly *false* that all the all goblins are cured at the beginning . . . .
### REQUIREMENTS:
1. Use for loops for this exercise! You will eventually need a loop within a loop.
2. Once you have your goblins array populated with the final *true* and *false* values after having gone through the entire process of curing and uncuring, translate your final array to another array of numerical values of the **cured Goblins only**. If the first Goblin is cured, the first number in the array will be 1 (not zero). If the 100th Goblin is cured, the last number in the array will be 100. The expected output (solution) will be a list of all the perfect squares up to and including 100.
```
=> [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
```

@ -0,0 +1,224 @@
// =================================
// THOM'S
// =================================
// make an array of goblins
var goblins = [];
for (var i=0; i < 100; i++) {
goblins.push(false);
}
// do stuff
for (var i=0; i < goblins.length; i++) {
for (var j=i; j < goblins.length; j += (i + 1)) {
goblins[j] = !goblins[j];
}
}
// change the result to numbers
var result = [];
for (var i=0; i < goblins.length; i++) {
if (goblins[i]) {
result.push(i + 1);
}
}
console.log(result);
//====================================
// JESSE'S
//====================================
var goblins = [];
for (var i = 0; i < 100; i++) {
goblins.push(false);
};
var cureAllGoblins = function(goblins, callback) {
// Set all the goblins to true
for (var i = 0; i < goblins.length; i++) {
goblins[i] = true;
}
// Set the starting position for the goblins and the rate
// So in this case, num = starting with the 2nd goblin and rate is
// curing every two goblins
var num = 1;
var rate = 2;
// Use the callback passing in those starter values
return callback(num, rate)
}
var fakeCureGoblins = function(num, rate) {
// After 100 loops
if (num >= 100) {
var array = [];
for (var i = 0; i < goblins.length; i++) {
// If it's true, push the index to the array
if (goblins[i]) {
// Shift index by 1
array.push(i+1);
};
};
// And return it
return array;
};
// Loop over the goblins based off the num / rate passed in
for (var i = num; i < goblins.length; i+=rate) {
goblins[i] = !goblins[i];
}
// Increment the starting position for 1 goes to 2 to start at the 3rd goblin
// and rate goes from 2 to 3 to go every third goblin
num++;
rate++;
return fakeCureGoblins(num, rate);
};
console.log(cureAllGoblins(goblins, fakeCureGoblins));
//====================================
// AMBER'S
//====================================
// first set up array of all goblins
// set up object with all values false iterating through array
goblinObject = {};
for (i = 1; i < 101; i++) {
goblinObject[i] = false;
}
console.log('initial setup: ', goblinObject);
// loop
for (i = 1; i < 101; i++) {
// now need another loop inside to iterate through the i's
for (j = i; j < 101; j = j + i) {
// now, need to run through and change all trues to falses and vice versa
if (goblinObject[j] == false) {
goblinObject[j] = true;
}
else if (goblinObject[j] == true) {
goblinObject[j] = false;
}
}
}
console.log(goblinObject);
// delete objects from array
for (i = 1; i < 101; i++) {
if (goblinObject[i] == false) {
delete goblinObject[i];
}
}
// console.log(goblinObject);
// make an array of true values only
var goblinArray = [];
for (var key in goblinObject) {
goblinArray.push(key);
}
console.log(goblinArray);
//====================================
// DEREK'S
//====================================
var goblins = [];
// pushing goblin objects into array
for (var i=1; i < 101; i++) {
var goblin = {
id: i,
cured: false,
};
goblins.push(goblin);
};
// counter to increase nested loop properly
var count = 1;
for (var i=0; i < goblins.length; i++) {
for (var j=i; j < goblins.length; j = j+count) {
if (goblins[j].cured == true) {
goblins[j].cured = false;
} else if (goblins[j].cured == false) {
goblins[j].cured = true;
}
}
count += 1;
};
var finalArray = [];
for (var i=0; i < goblins.length; i++) {
if (goblins[i].cured == true) {
finalArray.push(goblins[i].id);
}
};
console.log(finalArray);
//====================================
// JOHN'S
//====================================
goblinArray = [];
for (var i = 1; i < 101; i++) {
goblinArray.push({
number : i,
cured : false
})
};
var count = 0;
var cureAll = function () {
for (var i = 0; i < goblinArray.length; i++) {
goblinArray[i].cured = true;
}
count += 1;
};
cureAll();
var reviseCure = function () {
for (var i = count; i < goblinArray.length; i += (count+1)) {
if (goblinArray[i].cured === false) {
goblinArray[i].cured = true;
} else if (goblinArray[i].cured === true) {
goblinArray[i].cured = false;
}
}
count += 1;
// console.log(count);
}
while (count < 100) {
reviseCure();
}
var curedArray = [];
for (var i = 0; i < goblinArray.length; i++ ) {
if (goblinArray[i].cured === true) {
curedArray.push(goblinArray[i].number);
}
}
console.log("Here are the cured goblin numbers " + curedArray);
Loading…
Cancel
Save