Newest at the top
2024-05-17 14:54:19 +0200 | danse-nr3 | (~danse-nr3@151.44.168.106) |
2024-05-17 14:53:41 +0200 | danse-nr3 | (~danse-nr3@151.46.212.14) (Ping timeout: 252 seconds) |
2024-05-17 14:47:49 +0200 | <Guest13> | so memo = tabulate bounds (get memo) |
2024-05-17 14:47:20 +0200 | <Guest13> | maybe it would be best to lazily pass the memo to the "get" function and define it somewhere else? |
2024-05-17 14:46:39 +0200 | <Guest13> | it is basically same code as the unmemorised function |
2024-05-17 14:46:12 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
2024-05-17 14:45:53 +0200 | <Guest13> | and my answer is contained within (0,0,0) |
2024-05-17 14:45:17 +0200 | <Guest13> | I have a function "get" which is meant to be the recursive part which refers to the memoized array inside it |
2024-05-17 14:44:25 +0200 | joeyadams | (~joeyadams@2603:6010:5100:2ed:e620:4fb2:2e9f:c7fe) |
2024-05-17 14:43:20 +0200 | <Guest13> | https://play.haskell.org/saved/WOB84oaz |
2024-05-17 14:40:28 +0200 | <Guest13> | sorry ill send a link |
2024-05-17 14:39:39 +0200 | <yushyin> | pls ... |
2024-05-17 14:39:38 +0200 | <Guest13> | groupTarget = grps !! grp |
2024-05-17 14:39:38 +0200 | <Guest13> | where cur = springs !! I |
2024-05-17 14:39:37 +0200 | <Guest13> | | otherwise = undefined |
2024-05-17 14:39:37 +0200 | <Guest13> | | cur == Unknown = dotCase + hashCase |
2024-05-17 14:39:36 +0200 | <Guest13> | | cur == Damaged = hashCase |
2024-05-17 14:39:36 +0200 | <Guest13> | | cur == Operational = dotCase |
2024-05-17 14:39:35 +0200 | <Guest13> | | grp == length grps = if ((springs !! i) == Damaged) then 0 else dotCase -- matched all groups |
2024-05-17 14:39:35 +0200 | <Guest13> | | i == length springs = if (count == 0 && grp == length grps) then 1 else endOnHash -- end of springs |
2024-05-17 14:39:34 +0200 | <Guest13> | get ixx@(i, grp, count) |
2024-05-17 14:39:34 +0200 | <Guest13> | memo = tabulate bounds get |
2024-05-17 14:39:33 +0200 | <Guest13> | where bounds = ((0,0,0), (length springs, length grps, length springs)) |
2024-05-17 14:39:33 +0200 | <Guest13> | | otherwise = memo ! ix |
2024-05-17 14:39:32 +0200 | <Guest13> | | count < 0 || count > length springs = undefined |
2024-05-17 14:39:32 +0200 | <Guest13> | | grp < 0 || grp > length grps = undefined |
2024-05-17 14:39:31 +0200 | <Guest13> | | i < 0 || i > length springs = undefined |
2024-05-17 14:39:31 +0200 | <Guest13> | permutationsMemo problem@(springs, grps) ix@(i, grp, count) |
2024-05-17 14:39:30 +0200 | <Guest13> | permutationsMemo :: Problem -> (Int, Int, Int) -> Int |
2024-05-17 14:39:30 +0200 | <Guest13> | mine looks like: |
2024-05-17 14:38:50 +0200 | <Guest13> | [Leary] I have no clue what is going on there XD |
2024-05-17 14:37:49 +0200 | <ski> | nice, Guest13 ! |
2024-05-17 14:32:20 +0200 | <[Leary]> | Check the link? |
2024-05-17 14:32:07 +0200 | <Guest13> | ah what's that? |
2024-05-17 14:31:54 +0200 | <[Leary]> | (the dirty way to memoise a recursive function with a Map) |
2024-05-17 14:31:24 +0200 | Nixkernal | (~Nixkernal@240.17.194.178.dynamic.wline.res.cust.swisscom.ch) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2024-05-17 14:31:03 +0200 | danse-nr3 | (~danse-nr3@151.46.212.14) |
2024-05-17 14:30:40 +0200 | <Guest13> | ? |
2024-05-17 14:30:05 +0200 | <[Leary]> | Guest13: Speaking of, I got nerdsniped and figured out the dirty version: https://play-haskell.tomsmeding.com/saved/ukgOdGqj |
2024-05-17 14:29:47 +0200 | qqq | (~qqq@92.43.167.61) |
2024-05-17 14:13:58 +0200 | xff0x | (~xff0x@2405:6580:b080:900:4704:a3e5:3fba:c1dc) |
2024-05-17 14:10:07 +0200 | ft | (~ft@p508db8fc.dip0.t-ipconnect.de) |
2024-05-17 14:09:53 +0200 | libertyprime | (~libertypr@118-92-68-68.dsl.dyn.ihug.co.nz) (Remote host closed the connection) |
2024-05-17 14:04:03 +0200 | cfricke | (~cfricke@user/cfricke) |
2024-05-17 14:03:43 +0200 | cfricke | (~cfricke@user/cfricke) (Remote host closed the connection) |
2024-05-17 14:00:38 +0200 | rvalue- | rvalue |
2024-05-17 13:57:17 +0200 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 240 seconds) |
2024-05-17 13:56:36 +0200 | rvalue- | (~rvalue@user/rvalue) |
2024-05-17 13:55:49 +0200 | libertyprime | (~libertypr@118-92-68-68.dsl.dyn.ihug.co.nz) |
2024-05-17 13:55:03 +0200 | <Rembane> | \o/ |