Skip to content

Instantly share code, notes, and snippets.

@chengxiao
chengxiao / tree.go
Last active December 22, 2021 09:37
tree.go
type Data struct {
Id string `json:"id"`
Name string `json:"name"`
PId string `json:"p_id"`
Child []*Data `json:"child"`
}
type SliceData []*Data
func (s SliceData) Len() int {
@chengxiao
chengxiao / gist:5393578
Created April 16, 2013 05:26
about roll
# today my lucky number
from random import choice
a =raw_input("Please enter /roll + number :")
def roll(c):
y = choice(range(c))
return y
if a.startswith("/roll") :