This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends CharacterBody2D | |
| @export var speed = 80.0 | |
| var last_direction = "down" | |
| # Valeur pour limiter la marge de notre map | |
| var offset = 20 | |
| @onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D | |
| @onready var camera: Camera2D = $Camera2D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Activité : jeu de devinette | |
| */ | |
| // NE PAS MODIFIER OU SUPPRIMER LES LIGNES CI-DESSOUS | |
| // COMPLETEZ LE PROGRAMME UNIQUEMENT APRES LE TODO | |
| console.log("Bienvenue dans ce jeu de devinette !"); | |
| // Cette ligne génère aléatoirement un nombre entre 1 et 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 21/11/2017 | |
| printReverse() | |
| Write a function printReverse() that takes an array as an argument and prints out the elements in the array in reverse order (don't actually revese the array itself | |
| */ | |
| //printReverse([1,2,3,4]); | |
| //4 | |
| //3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 21/11/2017 | |
| printReverse() | |
| Write a function printReverse() that takes an array as an argument and prints out the elements in the array in reverse order (don't actually revese the array itself | |
| */ | |
| //printReverse([1,2,3,4]); | |
| //4 | |
| //3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| A Basic Multiplication Function 19/11/2017 | |
| In the uniqueMath.js file, build a function declaration called multiplyTrio that takes in three parameters. Inside the function, multiply the numbers together into one product, and return the result. You may use whatever parameter and variable names you’d like. | |
| */ | |
| function multiplyTrio (a,b,c) { | |
| return a*b*c; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Function Probleme Set | |
| */ | |
| /* | |
| isEven() | |
| Write a function isEven() which taked a single numeric argument and returns true if the | |
| number is even, and false otherwise | |
| */ | |
| /*function isEven(calculate) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Pop-Up Windows III | |
| With the userAge variable, we can ensure that the user has entered their age correctly. Use a pop-up window function to confirm the user entry with the following message: | |
| "You entered <age>. Is this correct?" | |
| Then store the result of the confirmation in a variable called ageIsCorrect. When you submit your code, enter your age in the prompt window, and then use the confirmation to select whether the entry is correct or incorrect. | |
| Note: You do not need any loops or conditionals to complete this challenge. | |
| */ | |
| var userAge = prompt("What's your age, user?"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Some Dam Complex Conditionals! | |
| The people at the Hoover Dam have called you back, and would like a program that shows what happens when only the even numbered turbines are turned on. And they want it all in just one for loop. | |
| With a set of complex conditional statements inside the loop, construct a way to only turn on even numbered turbines. Remember our power output situation: | |
| Generators 1 through 4 produce 62 MW. | |
| Generators 5 through 19 produce 124 MW. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Problem Solving with Conditionals | |
| Back at Death Valley, scientists could see that the Sheep Situation would quickly get out of control. They have decided that, for any month the population climbs above 10000, half of the sheep will be sent away to other regions. | |
| Inside our for loop, insert an if statement that: | |
| Removes half of the sheep population if the number of sheep rises above 10000. | |
| Prints the number of sheep being removed to the console in the following format: | |
| Removing <number> sheep from the population. | |
| Note: To complete the challenge, you only need to insert the if statement. You do not need to create an else statement or change any of the provided code. | |
| */ |
NewerOlder