Check-in [a208ae1aed]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add game
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:a208ae1aed95c302d806522bae4b7d0ed9084a7a
User & Date: tien 2016-11-29 00:10:24
Context
2016-11-29
00:10
add game Leaf check-in: a208ae1aed user: tien tags: trunk
00:04
add move check-in: 43ad7c5a1d user: tien tags: trunk
Changes

Added game.jl.











































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module Startup

using Gtk
using Gtk.ShortNames
push!(LOAD_PATH,pwd())
using SQLite
using databases
db = SQLite.DB("database.db")

#set up a window with title "START" with a shogi frame
win = @Window("START") |> (f = @Frame("SHOGI"))

StartGamebutton = @Button("Start Game Now")
hbox = @Box(:v)  #create hbox
push!(f, hbox) #push frame onto hbox

#create buttons on at the start window
Start = @Button("Start")
Continue = @Button("Continue")
Replay = @Button("Replay")
Quit = @Button("Quit")
push!(hbox, Start)
push!(hbox, Replay)
push!(hbox, Continue)
push!(hbox, Quit)

#Start button clicked
id1 = signal_connect(Start, "clicked") do widget
	Create_Table(db,"Score")
	InitializeScore(db)
	Create_Table(db,"moves")
	destroy(win)
	win1 = @Window("START") |> (f = @Frame("SHOGI"))
	hbox2 = @Box(:v)
	push!(f, hbox2)
	AI = @Button("Start Against AI")
	Human = @Button("Start against Human")
	Join = @Button("Join a game against a remote program")
	Host_AI = @Button("Host a game, using your AI as the player")
	Host_Human = @Button(" Host a game, with a human as the player")
	Host_Email = @Button("Start a new game over email.")
	push!(hbox2, AI)
	push!(hbox2, Human)
	push!(hbox2, Join)
	push!(hbox2, Host_AI)
	push!(hbox2, Host_Human)
	push!(hbox2, Host_Email)
	AI_G = false
	AIG = false
	HumanG = false
	JoinG = false
	Host_AIG = false
	Host_HumanG = false
	Host_EmailG = false

	#Against AI button clicked
	id11 = signal_connect(AI, "clicked") do widget
		global AI_G = true
	  global AIG = true
	  destroy(win1)
  end

	#Against Human button clicked
  id2 = signal_connect(Human, "clicked") do widget
		include("start.jl")
		global HumanG = true
		destroy(win1)
	end

	#Join against remote program clicked
	id3 = signal_connect(Join, "clicked") do widget
		global JoinG = true
		destroy(win1)
    end

	#Host an AI game button clicked
  id4 = signal_connect(Host_AI, "clicked") do widget
		global Host_AIG = true
		global AI_G = true
		destroy(win1)
	end

	#Host an human game button clicked
	id5 = signal_connect(Host_Human, "clicked") do widget
		global Host_HumanG = true
		destroy(win1)
    end

	#Host an email game button clicked
  id6 = signal_connect(Host_Email, "clicked") do widget
		global Host_EmailG = true
		destroy(win1)
    end

	showall(win1)
end

#Continue button clicked
id2 = signal_connect(Continue, "clicked") do widget
	println("\"", getproperty(widget,:label,String), "\" was clicked!")
	#ContGame()
end

#Replay button Clicked
id3 = signal_connect(Replay, "clicked") do widget
    println("\"", getproperty(widget,:label,String), "\" was clicked!")
end

#Quit button clicked
id4 = signal_connect(Quit, "clicked") do widget
    println("\"", getproperty(widget,:label,String), "\" was clicked!")
	destroy(win)
end
showall(win)


end