Skip to content

Instantly share code, notes, and snippets.

View TFlexSoom's full-sized avatar
🃏
Playing Magic

Tristan Hilbert TFlexSoom

🃏
Playing Magic
View GitHub Profile
@TFlexSoom
TFlexSoom / warmup-JuneSeventh.py
Created June 8, 2020 00:00
Create a function that returns if a string contains at least 3 a's
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
# 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:
@TFlexSoom
TFlexSoom / GiveMeDiamondSword.java
Created May 28, 2020 00:19
This is an added-to example of ExampleMod.java for Forge API. This gives the player a diamond sword when they type in "/item"
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;
@TFlexSoom
TFlexSoom / Wicked Python Assignment
Created May 28, 2020 00:02
Assignment For Sorting, Lists, and Looping
"""
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
@TFlexSoom
TFlexSoom / CodestersTurtle-StepByStep
Created May 27, 2020 22:58
A Fun challenge to do in Codesters
"""
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()
@TFlexSoom
TFlexSoom / Looping Through Lists and Strings Examples CWK
Created May 20, 2020 23:51
This shows some examples of way to loop through lists and strings using for.
lst = []
lst.append(1)
lst.append(2)
lst.append(3)
lst.append(4)
lst.append(5)
print(lst)
var = "hello"
@TFlexSoom
TFlexSoom / Counting Sum
Created May 20, 2020 23:21
A Gist For A CWK class warmup
# 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
@TFlexSoom
TFlexSoom / ExampleMod.java
Created May 15, 2020 21:28
Example Mod With a For Loop For command!
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;
@TFlexSoom
TFlexSoom / text_rpg.py
Last active April 3, 2020 16:13
text_rpg minimum file for cool base classes and boilerplate code.
# Tristan Hilbert
# Text RPG Engine
import random
class Character:
def __init__(self):
self.name = "default"
self.health = 100
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;