Skip to content

Commit

Permalink
Run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 12, 2024
1 parent 93df694 commit fc269b1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
22 changes: 11 additions & 11 deletions src/interactions/map_campus_house_1/bedroomShelf.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { updateEnergyState } from '../../utils/energyUpdate';
import { getRandomTip } from '../../utils/randomTip';

export const bedroomShelfInteractions = (player, k, map) => {
player.onCollide('bedroom_shelf', () => {
player.isInDialog = true;
player.onCollide('bedroom_shelf', () => {
player.isInDialog = true;

displayDialogue({
k,
player,
text: ["Here's a tip for learning to code:", getRandomTip()],
onDisplayEnd: () => {
player.isInDialog = false;
},
displayDialogue({
k,
player,
text: ["Here's a tip for learning to code:", getRandomTip()],
onDisplayEnd: () => {
player.isInDialog = false;
},
});
updateEnergyState(player.state, player.state.energy + 5);
});
updateEnergyState(player.state, player.state.energy + 5);
});
};
2 changes: 1 addition & 1 deletion src/interactions/map_campus_house_1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const interactions = [
mageInteractions,
bedroomVanityInteractions,
kitchenFridgeInteractions,
bedroomShelfInteractions
bedroomShelfInteractions,
];

export default interactions;
61 changes: 31 additions & 30 deletions src/utils/randomTip.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@

export const getRandomTip = () => {
// Feel free to add additional tips to this array.
const tipsForLearningToCode = [
'Start by understanding the fundamentals like variables, loops, and functions before diving into more complex topics.',
'Practice regularly by building small projects or solving coding challenges to solidify your knowledge.',
"Don't be afraid to make mistakes; debugging is a key part of the learning process and will help you improve.",
"Read and understand other people's code; it can expose you to new techniques and approaches to solving problems.",
'Break down complex problems into smaller, manageable parts to avoid feeling overwhelmed.',
'Use comments in your code to explain your thought process and make it easier to understand later.',
'Leverage online resources like Stack Overflow and documentation when you get stuck, but try to solve problems on your own first.',
'Learn how to effectively use a debugger or console to trace and fix errors in your code.',
'Write clean and readable code by following best practices such as consistent indentation and meaningful variable names.',
"Don't focus too much on memorizing syntax: understanding concepts and knowing where to find answers is more important.",
'Start with one language and get comfortable with it before moving on to others.',
'Use version control systems like Git to keep track of changes and collaborate with others.',
'Focus on learning how to think logically and solve problems rather than just learning syntax.',
'Set small, achievable goals to stay motivated and measure your progress over time.',
"Get comfortable reading official documentation, as it's often the best source of information.",
'Pair programming with a friend or mentor can help you learn faster and gain new perspectives.',
'Write tests for your code to ensure it works as expected and is easy to maintain in the future.',
'Keep your functions and code blocks small and focused on one task to improve readability and reusability.',
'Understand how data structures like arrays, objects, and lists work, as they are fundamental in coding.',
'Always keep learning and stay curious—new frameworks, libraries, and tools are constantly being developed.',
];

// Feel free to add additional tips to this array.
const tipsForLearningToCode = [
"Start by understanding the fundamentals like variables, loops, and functions before diving into more complex topics.",
"Practice regularly by building small projects or solving coding challenges to solidify your knowledge.",
"Don't be afraid to make mistakes; debugging is a key part of the learning process and will help you improve.",
"Read and understand other people's code; it can expose you to new techniques and approaches to solving problems.",
"Break down complex problems into smaller, manageable parts to avoid feeling overwhelmed.",
"Use comments in your code to explain your thought process and make it easier to understand later.",
"Leverage online resources like Stack Overflow and documentation when you get stuck, but try to solve problems on your own first.",
"Learn how to effectively use a debugger or console to trace and fix errors in your code.",
"Write clean and readable code by following best practices such as consistent indentation and meaningful variable names.",
"Don't focus too much on memorizing syntax: understanding concepts and knowing where to find answers is more important.",
"Start with one language and get comfortable with it before moving on to others.",
"Use version control systems like Git to keep track of changes and collaborate with others.",
"Focus on learning how to think logically and solve problems rather than just learning syntax.",
"Set small, achievable goals to stay motivated and measure your progress over time.",
"Get comfortable reading official documentation, as it's often the best source of information.",
"Pair programming with a friend or mentor can help you learn faster and gain new perspectives.",
"Write tests for your code to ensure it works as expected and is easy to maintain in the future.",
"Keep your functions and code blocks small and focused on one task to improve readability and reusability.",
"Understand how data structures like arrays, objects, and lists work, as they are fundamental in coding.",
"Always keep learning and stay curious—new frameworks, libraries, and tools are constantly being developed."
];

// Select a random tip from the array
const randomTip = tipsForLearningToCode[Math.floor(Math.random() * tipsForLearningToCode.length)];
// Select a random tip from the array
const randomTip =
tipsForLearningToCode[
Math.floor(Math.random() * tipsForLearningToCode.length)
];

// Return the random tip
return randomTip;
}
// Return the random tip
return randomTip;
};

0 comments on commit fc269b1

Please sign in to comment.