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
| # 練習:猜數字遊戲 | |
| 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 _____ __ ______: # 如果猜對了 |
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
| 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]: |
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
| <!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"> |
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 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): |
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 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 = []; |
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 os, signal | |
| child = [] | |
| def child_burning(): | |
| i = 123.456 | |
| while True: | |
| i = i * 12.34 + 56.78 | |
| i %= 345.678 |
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 os | |
| from tkinter import * | |
| HEIGHT = 32 | |
| WIDTH = 80 | |
| root = Tk() | |
| root.title("Text editor") | |
| def onlist(): |
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
| from tkinter import * | |
| root = Tk() | |
| root.title("Listbox Demo") | |
| def on_add(): | |
| text = txtContent.get() | |
| listbox.insert(END, text) | |
| def on_del(): |
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 time | |
| import math | |
| from tkinter import * | |
| root = Tk() | |
| root.title("Painter") | |
| ######################### | |
| # # |
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
| from tkinter import * | |
| import math | |
| lasty, lastx = 0, 0 | |
| def left_click_event(event): | |
| global lastx, lasty | |
| lastx = event.x | |
| lasty = event.y |