Lenormand 3 Card Reading Generator

For this project I decided to create a generator for a three card Lenormand card reading. If you’re unfamiliar, Lenormand cards are similar to tarot cards.
The generator picks 1 of 36 cards and a position (upright or reversed) 3 times. The first card represents the situation, the second card represents the action to take and the third card represents the solution.

the code

I haven’t learned how to link JS to a website yet but when I do I plan on updating this project.

I’d love to get some feedback

2 Likes

Hello.

I had a look at your project and it worked well. I’m not sure what feedback you are looking for.

The feedback guidelines suggest:

  • Ask for specific feedback, e.g. “Is there a more efficient way to query this data?”; “Do you agree with my findings?”

I had a go at writing another version of your code, and used more functions and less variables.

Perhaps you could have a look for comparison?

Here is a link to my Codespace.

What do you think? Are there any advantages to using less variables?

Hi,
Thank you so much for taking the time to look at my code! I tried to look at yours to compare but I kept getting a 404 error

Hello again, sorry the link didn’t work for you. Here is my code:

//a deck of Lenormand cards and possible positions
const fortune = { 
    card: ['Rider', 'Clover', 'Ship', 'House', 'Tree', 'Clouds', 'Snake', 'Coffin', 'Bouquet', 'Scythe', 'Whip', 'Birds', 'Child', 'Fox', 'Bear', 'Stars', 'Stork', 'Dog', 'Tower', 'Garden', 'Mountain', 'Crossroads', 'Mice', 'Heart', 'Ring', 'Book', 'Letter', 'Man', 'Woman', 'Lily', 'Sun', 'Moon', 'Key', 'Fish', 'Anchor', 'Cross'],
    position: ['upright', 'reversed']
};

//3 functions to randomly draw a card & position, and return a text message
const cardPull = () => fortune.card[Math.floor(Math.random()*fortune.card.length)];
const cardPosition = () => fortune.position[Math.floor(Math.random()*fortune.position.length)];
const generatedFortune = () => `You drew the ${cardPull()} card. The card is ${cardPosition()}.`;

//draw 3 cards and display fortune to user
const draws = ['Situation', 'Action', 'Solution'];
console.log();
for (each of draws) {
    console.log(each + ': ' + generatedFortune());
    };
console.log();