March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
22
Task/Priority-queue/AutoHotkey/priority-queue-2.ahk
Normal file
22
Task/Priority-queue/AutoHotkey/priority-queue-2.ahk
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
data =
|
||||
(
|
||||
3 Clear drains
|
||||
1 test
|
||||
4 Feed cat
|
||||
5 Make tea
|
||||
1 Solve RC tasks
|
||||
2 Tax return
|
||||
)
|
||||
PQ:=[] ; Create Priority Queue PQ[Task, Priority]
|
||||
loop, parse, data, `n, `r
|
||||
F:= StrSplit(A_LoopField, "`t") , PQ[F[2]] := F[1]
|
||||
PQ_View(PQ)
|
||||
MsgBox, 262208,, % "Top Priority item(s)=`n" PQ_Peek(PQ) "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % "Add : " PQ_AddTask(PQ, "AutoHotkey", 2) "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % "Remove Top Item : " PQ_TopItem(PQ) "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % "Remove specific top item : " PQ_TopItem(PQ,"test") "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % "Delete Item : " PQ_DelTask(PQ, "Clear drains") "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % (Task:="Tax return") " new priority = " PQ_Edit(PQ,task, 7) "`n`n" PQ_View(PQ)
|
||||
MsgBox, 262208,, % (Task:="Feed cat") " priority = " PQ_Check(PQ,task)"`n`n" PQ_View(PQ)
|
||||
^Esc::
|
||||
ExitApp
|
||||
Loading…
Add table
Add a link
Reference in a new issue