Chris Jester-Young

Jun 6, 2016 03:39
If the book hasn't talked about let yet, has it talked about internal define? :-) If so, that's a way to get around the lack of let.
Jun 6, 2016 03:35
I believe I even mentioned this in item 1 of my review comments.
Jun 6, 2016 03:35
@morbidCode My comment about correctness is conditioned upon being able to separate out the next and prev like using my let (or something similar in idea). Without being able to separate out the two, your test isn't quite correct.
Jun 5, 2016 18:31
Sass can sometimes be a pain to work with (as shown in the first diff linked above) but I still haven't found anything better, so. ;-)
Jun 5, 2016 18:29
@morbidCode I put in two links, the game itself as well as the code repo. The actual changes I worked on at the time are here: 1 2
Jun 5, 2016 18:27
@morbidCode Cool, I'm glad to be of help! Especially with regard to the redundancy. I'm surprised about not being able to use let (it's a very basic Scheme construct!) but it's what it is. :-)
Jun 4, 2016 06:27
@morbidCode It doesn't look obviously bogus. I tested 65535 for fun, which enabled me to find a bug in my version. :-P
Jun 3, 2016 17:01
All right, I'll go to my next appointment now. I'll check back later tonight and see how else I can be of help. :-D
Jun 3, 2016 17:00
As for the code I was working on, if you're curious, I pushed some changes to EmojiSweeper (code repo) this morning. :-)
Jun 3, 2016 16:55
@morbidCode I hope the above ^ answered your questions some! Please feel free to ask further.
Jun 3, 2016 16:55
and then you can do the tests you need to against prev and next.
Jun 3, 2016 16:54
(let* ((prev (modexp base (/ exp 2) m))
       (next (remainder (square prev) m)))
  ...)
Jun 3, 2016 16:53
In my code, I had (something like):
Jun 3, 2016 16:53
As for ^, you can check for that by checking the value (remainder (square (modexp base (/ exp 2) m)) m) against 1. You may need to stash the value using a let for later use.
Jun 3, 2016 16:52
Also, how would you check if base mod 1 if it's getting square outside of the procewdure and not being updated inside? — morbidCode 11 hours ago
Jun 3, 2016 16:51
2. (remainder (expmod ... m) m) is completely redundant since the return value of the (expmod ... m) is already supposed to be clipped to mod m (if not, then your expmod has a bug), so the remainder does nothing useful.
Jun 3, 2016 16:49
1. It allowed the base value of the recursive calls to get very, very big, since (square base) values are not clipped at each stage.
Jun 3, 2016 16:48
Your original approach of doing (remainder (expmod (square base) (/ exp 2) m) m) has two problems:
Jun 3, 2016 16:47
Okay, I have 30 minutes to answer some of your questions. Let's see how far I get.
Jun 3, 2016 06:04
@morbidCode Sorry, I was working on other code. Um. I'll try to answer your questions tomorrow after I check in my code.
Jun 3, 2016 04:51
@morbidCode (expmod base (/ exp 2) m) is the recursive case. You then square the result to get what you need, then you mod m so you can compare the result to 1.
Jun 3, 2016 04:51
@morbidCode Clamping x to mod m means (modulo x m), so that the result is always between 0 and m-1. The return value of expmod should, by contract, always be clamped to mod m, so the remainder call in your (remainder (expmod (square base) (/ exp 2) m) m) is redundant.
Jun 3, 2016 04:51
@morbidCode "You should, however, clamp the result of square to mod m" means use (expmod (remainder (square base) m) (/ exp 2) m) instead. Or, as in my version, (remainder (square (expmod base (/ exp 2) m)) m). Notice how, in both cases, the shape of the expression is (remainder (square ...)), not (remainder (expmod ...)).
 

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Apr 27, 2016 18:34
@quartata Just writing to let you know I haven't forgotten your program! I have some comments to write on it, but I'm busy preparing for a lightning talk I'm giving tomorrow, so I'll try to do it after this weekend. :-)
Apr 26, 2016 18:02
@orlp ;-)
Apr 26, 2016 17:58
@orlp Yep, come join us on #chez on freenode. :-D
Apr 16, 2016 19:23
@poi830 I'm not a mod any more so I can't ding you for this, but that's seriously not cool.
Apr 16, 2016 02:10
@AlexA. :-D
Apr 16, 2016 02:10
@EasterlyIrk It's too much effort for me to log into Steam at the moment, sorry.
Apr 16, 2016 02:09
@AlexA. cky944
Apr 16, 2016 02:01
:shrug:
Apr 16, 2016 01:59
1 min ago, by Chris Jester-Young
@El'endiaStarman That explains it, really: it sounds like it stops reading after 100 characters.
Apr 16, 2016 01:58
@El'endiaStarman That explains it, really: it sounds like it stops reading after 100 characters.
Apr 16, 2016 01:54
@Doorknob I read that as fiancée instead of fleece, lol.
Apr 16, 2016 01:52
@NathanMerrill Sorry; see you in Round 1B or 1C. ;-)
Apr 16, 2016 01:50
@EasterlyIrk Aye.
Apr 16, 2016 01:43
Apr 16, 2016 01:41
/me goes and eats tasty dinner.
Apr 16, 2016 01:41
So I'm going to go for 1B or 1C, if I can be bothered. ;-)
Apr 16, 2016 01:40
I believe I'm not going to pass Round 1A. The 1000th place is already at score 55, and I'm not going to bother to solve problem C.
Apr 16, 2016 01:39
@poi830 Correct.
Apr 16, 2016 01:38
@MarsUltor Yeah, in that case unless you can solve B and C super-fast, you may have to wait it out till Round 1B or 1C.
Apr 16, 2016 01:37
You still have to solve B and C faster than most contestants.
Apr 16, 2016 01:37
@MarsUltor It is. In that you have to get on the top 1000.
Apr 16, 2016 01:37
@MarsUltor Unsurprisingly, you mean.
Apr 16, 2016 01:22
@AlexA. I wish.
Apr 16, 2016 01:22
Round 3, probably not.
Apr 16, 2016 01:21
@AlexA. I've gotten to Round 2 before.
Apr 16, 2016 01:21
@AlexA. If you are among the top 1000 contestants, you get to go to Round 2.
Apr 16, 2016 01:18
35 mins ago, by Chris Jester-Young
Speed really is everything.