Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- global massive_size:={h:18,w:32}
- global square:=15
- global game:={h:square*massive_size.h,w:square*massive_size.w,how_many_snakes:10}
- global string_for_tooltip
- global massive_x_y:=[]
- build_border()
- build_tooltip()
- SetTimer,show_tooltip,10
- return
- show_tooltip:
- ToolTip,% string_for_tooltip
- return
- build_border(){
- ;~ massive_x_y
- ;~ massive_size:={h:18,w:32}
- temp:=[]
- for_loop := massive_size.h
- loop % for_loop {
- temp.insert(1)
- }
- massive_x_y.insert(temp)
- for_loop := massive_size.w - 2
- loop % for_loop {
- temp:=[]
- temp.insert(1)
- loop % massive_size.h - 2 {
- temp.insert(0)
- }
- temp.insert(1)
- massive_x_y.Insert(temp)
- }
- temp:=[]
- for_loop := massive_size.h
- loop % for_loop {
- temp.insert(1)
- }
- massive_x_y.Insert(temp)
- }
- build_tooltip(){
- i:=massive_x_y.length()
- Random,ran,1,i
- j:=massive_x_y[i].length()
- string_for_tooltip:=i " " j "`n"
- loop % j {
- jj:=A_Index
- loop % i {
- ii:=A_Index
- string_for_tooltip.= massive_x_y[ii][jj]
- }
- string_for_tooltip.="`n"
- }
- }
- x::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement