@program lotterystudy.muf 1 10000 d i $include $lib/alynna lvar param : sladd prog "sl" array_get_proplist var! x param @ x @ []<- x ! prog "sl" x @ array_put_proplist { "Lottery result: " param @ " added. " x @ array_count " results in database." }tell ; : slcheck var v1 var v2 var v3 var v4 var v5 var v6 var v7 var v8 var v9 var v10 var vmega1 var vmega2 var vmega3 var vmega4 var vmega5 var c1 var c2 var c3 var c4 var c5 var c6 var c7 var c8 var c9 var c10 var cmega1 var cmega2 var cmega3 var cmega4 var cmega5 0 array_make_dict var! lottocount 0 array_make_dict var! megacount var cur { "Aggregating numerics, please wait..." }tell prog "sl" array_get_proplist var! x x @ foreach swap pop " " rsplit atoi cur ! megacount @ cur @ [] ++ megacount @ cur @ ->[] megacount ! " " explode_array foreach swap pop atoi cur ! lottocount @ cur @ [] ++ lottocount @ cur @ ->[] lottocount ! repeat repeat { "Results: " }tell { "Number Lotto Mega" }tell lottocount @ foreach var! value var! item { item @ intostr 8 lj value @ intostr 8 lj megacount @ item @ [] intostr 8 lj }tell value @ c1 @ > if item @ v1 ! value @ c1 ! else value @ c2 @ > if item @ v2 ! value @ c2 ! else value @ c3 @ > if item @ v3 ! value @ c3 ! else value @ c4 @ > if item @ v4 ! value @ c4 ! else value @ c5 @ > if item @ v5 ! value @ c5 ! else value @ c6 @ > if item @ v6 ! value @ c6 ! else value @ c7 @ > if item @ v7 ! value @ c7 ! else value @ c8 @ > if item @ v8 ! value @ c8 ! else value @ c9 @ > if item @ v9 ! value @ c9 ! else value @ c10 @ > if item @ v10 ! value @ c10 ! then then then then then then then then then then megacount @ item @ [] cmega1 @ > if item @ vmega1 ! megacount @ item @ [] cmega1 ! else megacount @ item @ [] cmega2 @ > if item @ vmega2 ! megacount @ item @ [] cmega2 ! else megacount @ item @ [] cmega3 @ > if item @ vmega3 ! megacount @ item @ [] cmega3 ! else megacount @ item @ [] cmega4 @ > if item @ vmega4 ! megacount @ item @ [] cmega4 ! else megacount @ item @ [] cmega5 @ > if item @ vmega5 ! megacount @ item @ [] cmega5 ! then then then then then repeat { "Super Lotto results:" }tell { "Best aggregated result: " v1 @ " " v2 @ " " v3 @ " " v4 @ " " v5 @ "-" vmega1 @ }tell { "2nd aggregated result: " v2 @ " " v3 @ " " v4 @ " " v5 @ " " v6 @ "-" vmega2 @ }tell { "3rd aggregated result: " v3 @ " " v4 @ " " v5 @ " " v6 @ " " v7 @ "-" vmega3 @ }tell { "4th aggregated result: " v4 @ " " v5 @ " " v6 @ " " v7 @ " " v8 @ "-" vmega4 @ }tell { "5th aggregated result: " v5 @ " " v6 @ " " v7 @ " " v8 @ " " v9 @ "-" vmega5 @ }tell { "Top 10 numbers: " }tell { v1 @ " occured " c1 @ " times" }tell { v2 @ " occured " c2 @ " times" }tell { v3 @ " occured " c3 @ " times" }tell { v4 @ " occured " c4 @ " times" }tell { v5 @ " occured " c5 @ " times" }tell { v6 @ " occured " c6 @ " times" }tell { v7 @ " occured " c7 @ " times" }tell { v8 @ " occured " c8 @ " times" }tell { v9 @ " occured " c9 @ " times" }tell { v10 @ " occured " c10 @ " times" }tell { "Top 5 megas: " }tell { vmega1 @ " occured " cmega1 @ " times" }tell { vmega2 @ " occured " cmega2 @ " times" }tell { vmega3 @ " occured " cmega3 @ " times" }tell { vmega3 @ " occured " cmega3 @ " times" }tell { vmega3 @ " occured " cmega3 @ " times" }tell ; : mmadd prog "mm" array_get_proplist var! x param @ x @ []<- x ! prog "mm" x @ array_put_proplist { "Lottery result: " param @ " added. " x @ array_count " results in database." }tell ; : mmcheck var v1 var v2 var v3 var v4 var v5 var v6 var v7 var v8 var v9 var v10 var vmega1 var vmega2 var vmega3 var vmega4 var vmega5 var c1 var c2 var c3 var c4 var c5 var c6 var c7 var c8 var c9 var c10 var cmega1 var cmega2 var cmega3 var cmega4 var cmega5 0 array_make_dict var! lottocount 0 array_make_dict var! megacount var cur { "Aggregating numerics, please wait..." }tell prog "mm" array_get_proplist var! x x @ foreach swap pop " " rsplit atoi cur ! megacount @ cur @ [] ++ megacount @ cur @ ->[] megacount ! " " explode_array foreach swap pop atoi cur ! lottocount @ cur @ [] ++ lottocount @ cur @ ->[] lottocount ! repeat repeat { "Results: " }tell { "Number Lotto Mega" }tell lottocount @ foreach var! value var! item { item @ intostr 8 lj value @ intostr 8 lj megacount @ item @ [] intostr 8 lj }tell value @ c1 @ > if item @ v1 ! value @ c1 ! else value @ c2 @ > if item @ v2 ! value @ c2 ! else value @ c3 @ > if item @ v3 ! value @ c3 ! else value @ c4 @ > if item @ v4 ! value @ c4 ! else value @ c5 @ > if item @ v5 ! value @ c5 ! else value @ c6 @ > if item @ v6 ! value @ c6 ! else value @ c7 @ > if item @ v7 ! value @ c7 ! else value @ c8 @ > if item @ v8 ! value @ c8 ! else value @ c9 @ > if item @ v9 ! value @ c9 ! else value @ c10 @ > if item @ v10 ! value @ c10 ! then then then then then then then then then then megacount @ item @ [] cmega1 @ > if item @ vmega1 ! megacount @ item @ [] cmega1 ! else megacount @ item @ [] cmega2 @ > if item @ vmega2 ! megacount @ item @ [] cmega2 ! else megacount @ item @ [] cmega3 @ > if item @ vmega3 ! megacount @ item @ [] cmega3 ! else megacount @ item @ [] cmega4 @ > if item @ vmega4 ! megacount @ item @ [] cmega4 ! else megacount @ item @ [] cmega5 @ > if item @ vmega5 ! megacount @ item @ [] cmega5 ! then then then then then repeat { "Mega millions results:" }tell { "Best aggregated result: " v1 @ " " v2 @ " " v3 @ " " v4 @ " " v5 @ "-" vmega1 @ }tell { "2nd aggregated result: " v2 @ " " v3 @ " " v4 @ " " v5 @ " " v6 @ "-" vmega2 @ }tell { "3rd aggregated result: " v3 @ " " v4 @ " " v5 @ " " v6 @ " " v7 @ "-" vmega3 @ }tell { "4th aggregated result: " v4 @ " " v5 @ " " v6 @ " " v7 @ " " v8 @ "-" vmega4 @ }tell { "5th aggregated result: " v5 @ " " v6 @ " " v7 @ " " v8 @ " " v9 @ "-" vmega5 @ }tell { "Top 10 numbers: " }tell { v1 @ " occured " c1 @ " times" }tell { v2 @ " occured " c2 @ " times" }tell { v3 @ " occured " c3 @ " times" }tell { v4 @ " occured " c4 @ " times" }tell { v5 @ " occured " c5 @ " times" }tell { v6 @ " occured " c6 @ " times" }tell { v7 @ " occured " c7 @ " times" }tell { v8 @ " occured " c8 @ " times" }tell { v9 @ " occured " c9 @ " times" }tell { v10 @ " occured " c10 @ " times" }tell { "Top 5 megas: " }tell { vmega1 @ " occured " cmega1 @ " times" }tell { vmega2 @ " occured " cmega2 @ " times" }tell { vmega3 @ " occured " cmega3 @ " times" }tell ; : main param ! command @ case "@sladd" smatch when sladd end "@sl" smatch when slcheck end "@mmadd" smatch when mmadd end "@mm" smatch when mmcheck end endcase ; . c q