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
local rs = component.proxy(component.list("redstone")()) | |
while true do | |
if rs.getInput(3) > 0 then | |
computer.beep() | |
end | |
computer.pullSignal() | |
end |
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
bad = open("bad_lyrics.txt", mode="r").read() | |
heaven = open("heaven_lyrics.txt", mode="r").read() | |
new = open("new_lyrics.txt", mode="w") | |
bad = bad.replace("bad", heaven) | |
new.write(bad) | |
new.close() |
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
def say_hi(name='World'): | |
if name == None or name == '': | |
name = "World" | |
if type(name) != str: | |
name = str(name) | |
return f"Hello, {name}!" |
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
elif message.content.startswith("AI, time"): | |
# UTC | |
tmp1 = datetime.datetime.now() | |
utcnow = datetime.time(hour=tmp1.hour, minute=tmp1.minute, second=tmp1.second) | |
del tmp1 | |
utcfulltime = "{}:{}:{}".format(utcnow.hour, utcnow.minute, utcnow.second) | |
# SMT | |
tmp1 = datetime.timedelta(hours=4) | |
smt = datetime.timezone(tmp1) |
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
require "date" | |
class DatBoi | |
attr_accessor :name | |
attr_accessor :life | |
attr_accessor :bornIn | |
attr_accessor :currentDate | |
attr_accessor :alive | |
def initialize(name = "Dat Boi", life = 365*4, bornIn = Date.parse("2016-04-03")) | |
@name = name | |
@life = life |
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
[scenario] | |
id=chapter1 | |
next_scenario=chapter2 | |
name=Chapter 1 - The Port In Ruins | |
map_data="{~add-ons/The_Invasion/scenarios/maps/prologue.map}" | |
turns=27 | |
{DEFAULT_SCHEDULE} | |
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
math.randomseed(os.time()) | |
print("Enter attacker skill stat:") | |
skill = io.read('*n') | |
while skill > 100 or skill < 0 do | |
print("This number is invalid.") | |
print("The number must be between 0 and 100.") | |
print("Enter attacker skill stat:") | |
skill = io.read('*n') | |
end |
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 discord | |
import asyncio | |
import textile | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name ) |
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 discord | |
import asyncio | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name ) | |
print(client.user.id) |
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
#include <iostream> | |
int getUserInput() { | |
std::cout << "Please input an integer: "; | |
int value; | |
std::cin >> value; | |
return value; | |
} | |
int getMathematicalOperation() { |
NewerOlder