Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
22
Task/Priority-queue/FunL/priority-queue.funl
Normal file
22
Task/Priority-queue/FunL/priority-queue.funl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import util.ordering
|
||||
native scala.collection.mutable.PriorityQueue
|
||||
|
||||
data Task( priority, description )
|
||||
|
||||
def comparator( Task(a, _), Task(b, _) )
|
||||
| a > b = -1
|
||||
| a < b = 1
|
||||
| otherwise = 0
|
||||
|
||||
q = PriorityQueue( ordering(comparator) )
|
||||
|
||||
q.enqueue(
|
||||
Task(3, 'Clear drains'),
|
||||
Task(4, 'Feed cat'),
|
||||
Task(5, 'Make tea'),
|
||||
Task(1, 'Solve RC tasks'),
|
||||
Task(2, 'Tax return')
|
||||
)
|
||||
|
||||
while not q.isEmpty()
|
||||
println( q.dequeue() )
|
||||
Loading…
Add table
Add a link
Reference in a new issue