Advertisement
pastamaker

fun tootip : on my way towards semi snake

May 28th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6. global massive_size:={h:18,w:32}
  7. global square:=15
  8. global game:={h:square*massive_size.h,w:square*massive_size.w,how_many_snakes:10}
  9. global string_for_tooltip
  10. global massive_x_y:=[]
  11. build_border()
  12. build_tooltip()
  13.  
  14.  
  15. SetTimer,show_tooltip,10
  16.  
  17.  
  18.  
  19. return
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. show_tooltip:
  28.  
  29. ToolTip,% string_for_tooltip
  30.  
  31. return
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. build_border(){
  51.    
  52.     ;~ massive_x_y
  53.     ;~ massive_size:={h:18,w:32}
  54.    
  55.     temp:=[]
  56.     for_loop := massive_size.h
  57.     loop % for_loop {
  58.         temp.insert(1)
  59.    
  60.     }
  61.    
  62.     massive_x_y.insert(temp)
  63.     for_loop := massive_size.w - 2
  64.     loop % for_loop {
  65.         temp:=[]
  66.         temp.insert(1)
  67.         loop % massive_size.h - 2 {
  68.             temp.insert(0)
  69.         }
  70.         temp.insert(1)
  71.         massive_x_y.Insert(temp)
  72.     }
  73.         temp:=[]
  74.     for_loop := massive_size.h
  75.     loop % for_loop {
  76.         temp.insert(1)
  77.    
  78.     }
  79.    
  80.    
  81.     massive_x_y.Insert(temp)
  82.    
  83.        
  84.    
  85. }
  86.    
  87.    
  88.    
  89. build_tooltip(){
  90.    
  91.     i:=massive_x_y.length()
  92.     Random,ran,1,i
  93.     j:=massive_x_y[i].length()
  94.     string_for_tooltip:=i " " j "`n"
  95.     loop % j {
  96.         jj:=A_Index
  97.         loop % i {
  98.             ii:=A_Index
  99.         string_for_tooltip.= massive_x_y[ii][jj]
  100.        
  101.        
  102.        
  103.        
  104.        
  105.         }
  106.         string_for_tooltip.="`n"
  107.     }
  108.    
  109.    
  110.    
  111.    
  112.    
  113.    
  114.    
  115. }
  116.  
  117.  
  118.  
  119.  
  120. x::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement