This file contains 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
//--- Aura Script------------------------------------- | |
// Collect fire elementals | |
//--- Description------------------------------------------- | |
// Allows people to make mass elementals | |
//---------------------------------------------------- | |
public class Collect10FireElementalsQuestScript : QuestScript { | |
public override void Load() { |
This file contains 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
# https://youtu.be/kbwk1Tw3OhE | |
# I paused the video around 9 min and solved the problem. :) | |
# Take a time tuple and return a 2-tuple of ints representing the length of the input meeting. | |
# e.g. ('10:00', '10:30') => (0, 30) | |
def meeting_len(meeting): | |
start = meeting[0].split(':') | |
end = meeting[1].split(':') | |
return (abs(int(end[0])-int(start[0])), abs(int(end[1])-int(start[1]))) |
This file contains 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
# This was my idea before starting to code: | |
#[c, a, t] | |
#[a, t] | |
#[t, a] | |
#[(c, [(a, [(t, [])]), (t, [(a, [])])]), (a, [(c, [(t, [])]), (t, [(c, [])])]),...] | |
#[[cat, cta], [act, atc],...] | |
#[cat, cta, act, atc] | |
# Runtime: O(2^n) | |
# create a list of nested tuples and arrays (char, [tuples]) to represent curried strings |
This file contains 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
# 2021/11/10 | |
# Python is not the best for this, but the syntax makes it worth it. | |
# Set state_logging to false if you would rather see tests instead of state changes. | |
# heap_sort, fix_heap_up, and fix_heap_down are tail-recursive. | |
# They reduce their parameters and re-call themselves until they can return an answer. | |
try_me = [1,3,2,5,4] | |
state_logging = True |
This file contains 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
# Copyright (c) 2020 syminical. All Rights Reserved. | |
# 2020/3/12 | |
import math | |
class AWeirdTextFormat: | |
""" | |
This class handles encoding and decoding of text | |
using the weird text format. | |
""" | |
This file contains 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
#!/bin/Python3 | |
def calculateDistance(cityMap): | |
#helpers | |
def addSpot(x, y, v): | |
#spot is valid for a path, and spot has not been visted or overlaping path is shorter. | |
if mapMatrix[y][x] == '_' and (distanceMatrix[y][x] == -1 or distanceMatrix[y][x] > v): | |
#New spot has to be checked. | |
pathStack.append((x, y)) | |
#Distance to new path updated. |