Skip to content

Instantly share code, notes, and snippets.

View OrDuan's full-sized avatar

Or Duan OrDuan

View GitHub Profile
function encryptOrDecrypt(txt, pass) {
var ord = [];var buf = "";
for (z = 1; z <= 255; z++) {ord[String.fromCharCode(z)] = z}
for (j = z = 0; z < txt.length; z++) {
buf += String.fromCharCode(ord[txt.substr(z, 1)] ^ ord[pass.substr(j, 1)])
j = (j < pass.length) ? j + 1 : 0
}
import requests
from bs4 import BeautifulSoup
payload = {
'number': '3845',
'letter': '*',
'submitBtn': '',
}
response = requests.post(url='http://minmsakar.com/', data=payload)
bs = BeautifulSoup(response.text, 'html.parser')
table = bs.select('table')[1].select('tr')
@OrDuan
OrDuan / gambling.py
Last active April 21, 2017 17:27
An education concept of how can you gamble and earn enough money in N rounds game.
from time import sleep
import random
game_rounds = 10
test_times = 5
base_money = 100
win_rate = 70
def log(s):
print(s)