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
-- LUA SYNTAX (WIP) | |
-- PRINTING | |
-- Print a string | |
print("Hello World") | |
-- Print multiple strings | |
print("Hello","World") | |
-- Join/Concatenate two strings (gives errors if not strings) |
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
#----------------------------- | |
# Godot Code Snippets (2D) | | |
# By the Tutorial Doctor | | |
# Fri Sep 18 13:14:07 EDT 2015| | |
#----------------------------- | |
# MAKE AN OBJECT FOLLOW THE MOUSE | |
func followMouse(x): | |
var mouse_position = get_viewport().get_mouse_pos() |
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
# WIP | |
# By the Tutorial Doctor | |
# CLASSES | |
#------------------------------------------------------------ | |
class Element: | |
count = 0 | |
def __init__(self): | |
self.tag = 'p' | |
self.id = "elementID" | |
self.html = "<%s id=\"%s\"></%s>"%(self.id,self.tag,self.tag) |
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 Node2D | |
# Godot Script Syntax | |
# By the Tutorial Doctor | |
# Fri Oct 2 23:58:22 EDT 2015 | |
#----------------------------------------------------------- | |
# VARIABLES | DATA TYPES | | |
#----------------------------------------------------------- | |
# String | |
var name = "Tutorial Dcotor" |
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
# Drop this folder in a directory and run it. It will organize all of your files into folder by first letter | |
# This was inspired by my mom (maybe you can relate?) | |
# This took much longer than I thought it would to figure this out, but I learned which modules are good for file handling. | |
# It took about an hour to come up with the base of the program, which organizes files by first letter or number | |
# I would like it to eventually recursively go into folders getting files and organizing them into folders. | |
# This was made using a straight ahead approach. | |
# For beginners, a directory is a folder. | |
# By the Tutorial Doctor | |
# Sun Dec 20 23:40:49 EST 2015 | |
#------------------------------------------------------------------------------ |
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
# Coding | |
# https://ruby-doc.org/core-1.9.2/String.html | |
# http://www.peachpit.com/articles/article.aspx?p=1278994&seqNum=4 | |
def title1(name="") | |
puts "\n" + name.upcase + ":" | |
puts "-"*65 | |
end | |
#Note: '\n' doesn't create a new line. Must use "\n". |
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
import string | |
from random import * | |
characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" | |
password = "".join(choice(characters) for x in range(randint(8, 10))) | |
#print password | |
for x in range (151): | |
i = "".join(choice(characters) for x in range(randint(8, 10))) | |
with open("passwords.txt","a") as outfile: | |
outfile.write(i+"\n") |
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
L = [[1,2,[3]],4] | |
#test_list = [1, 2, 3,[[4]],[[[5]]],[6],[[7]]] | |
model = 9 | |
empty = [] | |
def get_numbers(mod,L): | |
global empty | |
#For each item in the list | |
for item in L: | |
#If the type of the model is the same as the item: |
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
import cmath | |
#https://www.youtube.com/watch?v=eaYX0Ee0Kcg | |
#This is my solution to the problem he provided. | |
points = [(-2,4),(0,-2),(-1,0),(2,5),(-2,-3),(3,2)] | |
orign = (0,0) | |
print(points) | |
def get_distance_between(P1,P2): | |
distance = cmath.sqrt((P2[1]-P1[1])**2+(P2[0]-P1[0])**2) | |
return distance |
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 intro = "Remove multiline comments to run the code therein" | |
var __version__ = "0.1" | |
document.write("Version:" +__version__) | |
function capitalize(s) | |
{ | |
return s[0].toUpperCase() + s.slice(1); | |
} | |
function title1(name=""){ |