| |||||||||||||||||
Working with lists Description A series of examples showing some of Mosel's list handling functionality:
Source Files By clicking on a file name, a preview is opened at the bottom of this page.
Data Files listmerge.mos (!****************************************************** Mosel User Guide Example Problems ================================= file listmerge.mos `````````````````` Merging two ordered lists into one ordered list. (c) 2008 Fair Isaac Corporation author: S. Heipcke, Aug. 2006 *******************************************************!) model "Merging lists" declarations K,L,M: list of integer end-declarations K:= [1,4,5,8,9,10,13] L:= [-1,0,4,6,7,8,9,9,11,11] writeln(K,L) forall(k in K) do while (L<>[] and k >= getfirst(L)) M += splithead(L,1) M+= [k] end-do writeln(M) end-model | |||||||||||||||||
© Copyright 2023 Fair Isaac Corporation. |