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
| string_a = "alphabetic" | |
| string_b = "an apple anchor" | |
| string_c = "lego my eggo" | |
| string_d = "you got this!" | |
| string_e = "i'll have the anaconda" | |
| def has_three_as(word): | |
| return True |
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
| # Checking if a word has a letter | |
| def check_for_letter(letter): | |
| global secret, public | |
| temp = "" | |
| i = 0 | |
| for c in secret: | |
| if c == letter: | |
| temp += c | |
| else: |
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
| package com.example.examplemod; | |
| import net.minecraft.block.Block; | |
| import net.minecraft.block.Blocks; | |
| import net.minecraft.entity.player.ServerPlayerEntity; | |
| import net.minecraft.item.Item; | |
| import net.minecraft.item.ItemGroup; | |
| import net.minecraft.item.ItemStack; | |
| import net.minecraft.item.ItemTier; | |
| import net.minecraft.item.Items; |
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
| """ | |
| We have a guessing game. I want you to do the following. | |
| - Collect all the answers into a list | |
| - Rank the answers to how close they were to the number | |
| This means | |
| - Grabbing the absolute difference of each guess and the answer | |
| - putting them into a list | |
| - sorting the list either through the standard library or some algorithm |
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
| """ | |
| The below example shows briefly how we can use a turtle to draw a square | |
| """ | |
| # variable name = turtle sprite("turtle", x, y) | |
| turtle = codesters.Sprite("turtle", 25, 25) | |
| # Give the Turtle a virtual pen | |
| turtle.pen_down() |
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
| lst = [] | |
| lst.append(1) | |
| lst.append(2) | |
| lst.append(3) | |
| lst.append(4) | |
| lst.append(5) | |
| print(lst) | |
| var = "hello" |
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
| # Get a positive number from the user | |
| pos_num_str = input("Give Me A Positive Number") | |
| # pos_num_str is a string when we obtain it. | |
| # it must be "casted" to a number | |
| pos_num = int(pos_num_str) | |
| # Add up all numbers between 1 and that number |
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
| package com.example.examplemod; | |
| import net.minecraft.block.Block; | |
| import net.minecraft.block.Blocks; | |
| import net.minecraft.entity.player.ServerPlayerEntity; | |
| import net.minecraft.server.MinecraftServer; | |
| import net.minecraft.util.text.StringTextComponent; | |
| import net.minecraft.util.text.TextComponent; | |
| import net.minecraftforge.common.MinecraftForge; | |
| import net.minecraftforge.event.CommandEvent; |
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
| # Tristan Hilbert | |
| # Text RPG Engine | |
| import random | |
| class Character: | |
| def __init__(self): | |
| self.name = "default" | |
| self.health = 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
| var obsCooldown = 40; | |
| var obstacleSpawner = obsCooldown; | |
| function updateGameState() { | |
| scrollSpeed += 0.001 | |
| // update player position and velocity | |
| player.y += player.y_velocity | |
| if (player.y >= groundLevel - PLAYER_SIZE) { // touching ground? | |
| player.y = groundLevel - PLAYER_SIZE; |