Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Nautical-bell/AutoHotkey/nautical-bell-1.ahk
Normal file
20
Task/Nautical-bell/AutoHotkey/nautical-bell-1.ahk
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
NauticalBell(hh, mm){
|
||||
Hr := 0, min := 30, Bells := [], pattern := []
|
||||
Loop 8 ; genrate 8 patterns
|
||||
{
|
||||
num := A_Index , code := ""
|
||||
while (num/2 >=1)
|
||||
code .= "** ", num := num-2
|
||||
code .= mod(A_Index, 2) ? "*" : ""
|
||||
pattern[A_Index] := code
|
||||
}
|
||||
loop, 48 ; 24 hours * 2 for every half an hour
|
||||
{
|
||||
numBells := !mod(A_Index, 8) ? 8 : mod(A_Index, 8) , min := 30
|
||||
if !Mod(A_Index, 2)
|
||||
hr++ , min := 00
|
||||
Bells[SubStr("0" hr, -1) ":" min] := numBells
|
||||
}
|
||||
Bells[00 ":" 00] := Bells[24 ":" 00] , numBells := Bells[hh ":" mm]
|
||||
return {"bells": numBells, "pattern": Pattern[numBells]}
|
||||
}
|
||||
13
Task/Nautical-bell/AutoHotkey/nautical-bell-2.ahk
Normal file
13
Task/Nautical-bell/AutoHotkey/nautical-bell-2.ahk
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
res := ""
|
||||
loop, 24
|
||||
{
|
||||
hr := SubStr("0" A_Index -1, -1)
|
||||
Loop 60
|
||||
{
|
||||
min := SubStr("0" A_Index -1, -1)
|
||||
if (min = 0 || min = 30)
|
||||
res .= hr ":" min "`t" NauticalBell(hr, min).bells "`t" NauticalBell(hr, min).pattern "`n"
|
||||
}
|
||||
}
|
||||
MsgBox, 262144, , % "Time`tBells`tPattern`n" res
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue