Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny world pre-OOP #618

Merged
merged 12 commits into from
Sep 27, 2022
Next Next commit
tiny wiorls pre-OOP
  • Loading branch information
YuraZagor committed Sep 19, 2022
commit ae1856422ff2d1a1cdb76445df73f506be0d7cd9
57 changes: 57 additions & 0 deletions submissions/YuraZagor/tiny world pre-oop/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const dog = {
species: "dog",
name: "JEff",
gender: "male",
legs: 4,
hands: 0,
saying: "bow-wwou!",
friend: 'everyone',
};
const cat = {
species: "cat",
name: "Kizma",
gender: "female",
legs: 4,
hands: 0,
saying: "meaaawurrr!",
friend: 0,
};
const woman = {
species: "human",
name: "Maria",
gender: "female",
legs: 2,
hands: 2,
saying: "Are U hungry, dear?",
friend: 'dog'
};
const man = {
species: "human",
name: "Grumio",
gender: "male",
legs: 2,
hands: 2,
saying: "Wanna beer with ice-cream!",
friend: "Maria"
};
const cat_woman = {
species: "catmandu",
name: "Anabelle",
gender: "female",
legs: 2,
hands: 2,
saying: cat.saying,
friend: "Grumio"
};

const inhabitants = [dog, cat, woman, man, cat_woman,]
let printArr = []

for (let i = 0; i< inhabitants.length; i++) {
printArr.push([])
for (let key in inhabitants[i]){
printArr[i].push(inhabitants[i][key])
}
}

printArr.forEach( item => print(item.join('; '),'div') )