Skip to content

Instantly share code, notes, and snippets.

View Inndy's full-sized avatar

Inndy Inndy

View GitHub Profile
@Inndy
Inndy / Guess Number Game Practice.py
Created October 15, 2014 09:58
Guess number game practice
# 練習:猜數字遊戲
from random import randint
r = randint(1, 10)
print("I have a random number: ", r)
secret = _______(1, 100) # 產生一個亂數
_____ True: # 剛剛教的迴圈
guess = input("Guess a number:")
guess = ___(_____) # 字串轉成數字
if _____ __ ______: # 如果猜對了
@Inndy
Inndy / OOXX Game.py
Created October 22, 2014 09:43
OOXX Game
from random import randint
chance = input("1 先手 2 後手:")
chance = int(chance) % 2 # 0後手 1先手
rows = [ str(i) for i in range(1, 10) ]
turn = chance
def check_win(data):
for i in range(3):
if data[i*3] == data[i*3 + 1] and data[i*3+1] == data[i*3 + 2]:
@Inndy
Inndy / AngularJS_practice.html
Last active August 29, 2015 14:08 — forked from anonymous/index.html
AngularJS practice
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
@Inndy
Inndy / readhead.py
Created October 29, 2014 17:21
Read CHEATENGINE dump file head
import sys, struct
CE_MAGIC = b'CHEATENGINE'
def usage(argv):
print('Usage: python {script} cheatengine-memory-dump-file'
.format(script = argv[0]))
return 0
def check_magic(data, magic):
var string_functions = require("./string_functions");
var tests = {
"*": ["", "a", "*", "a*", "cdef"],
"abc*": ["abc", "ddj", "abcd"],
"asdf": ["asdf", "asdfg"],
"as*df": ["asddf", "asqwertdf", "asqwertddf"],
"*eer": ["asdjfklajsklej;jfk;lseer", "eer", "aaaeer", " eer"]
},
results = [];
@Inndy
Inndy / warm-mac.py
Created December 12, 2014 06:49
Feel cold? Make your mac warm!
import os, signal
child = []
def child_burning():
i = 123.456
while True:
i = i * 12.34 + 56.78
i %= 345.678
@Inndy
Inndy / tk_text_editor.py
Created December 17, 2014 07:17
Very simple text editor using tkinter
import os
from tkinter import *
HEIGHT = 32
WIDTH = 80
root = Tk()
root.title("Text editor")
def onlist():
@Inndy
Inndy / tk_listbox_demo.py
Created December 17, 2014 09:26
Very simple tkinter listbox demo
from tkinter import *
root = Tk()
root.title("Listbox Demo")
def on_add():
text = txtContent.get()
listbox.insert(END, text)
def on_del():
@Inndy
Inndy / tk_canvas_clock.py
Last active August 29, 2015 14:11
Draw clock use tkinter
import time
import math
from tkinter import *
root = Tk()
root.title("Painter")
#########################
# #
@Inndy
Inndy / tk_painter.py
Last active August 29, 2015 14:11
Very simple painter use tkinter
from tkinter import *
import math
lasty, lastx = 0, 0
def left_click_event(event):
global lastx, lasty
lastx = event.x
lasty = event.y