The Unofficial Macro Scheduler Puzzler of the Week 3

Anything Really. Just keep it clean!

Moderators: Dorian (MJT support), JRL

hoangvo81
Pro Scripter
Posts: 69
Joined: Tue Feb 07, 2012 8:02 pm

Post by hoangvo81 » Wed Oct 02, 2013 10:07 pm

If possible give ender the rep or part of it since it was original his calculation that i used.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Oct 02, 2013 10:12 pm

Very noble. If you want to give Ender some of the rep that's up to you. Just look at his post and at the bottom is a "Reward Points" link. Pick that then type in a number and that's all there is to it.

hoangvo81
Pro Scripter
Posts: 69
Joined: Tue Feb 07, 2012 8:02 pm

Post by hoangvo81 » Wed Oct 02, 2013 10:25 pm

Thanks, i'll do that. did not know.

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Post by hagchr » Thu Oct 03, 2013 1:00 pm

Let>InitVal1=13.85
Let>RoundOffset=0.84
mdl>{trunc((%initval1%)-(%roundoffset%))+1}

EnderFFX
Pro Scripter
Posts: 92
Joined: Mon Mar 08, 2004 6:17 am

Post by EnderFFX » Thu Oct 03, 2013 2:17 pm

I'm just really enjoying these puzzles! Any points are appreciated but not necessary.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Oct 03, 2013 2:21 pm

hagchr,

Very good job reducing that down.

Even though the initial puzzler requirement was for "fewest lines" and your solution doesn't go to zero lines, I'll give you 10 rep points for your efforts... but only if you can figure out how to fix this problem. Don't worry, its an easy fix. I discovered last night that hoangvo81's solution still has an issue and your solution has the same issue. If "InitVal1" is less than 1, rounding always rounds up to 1. In other words,

Let>InitVal1=0.83
Let>RoundOffset=0.84
mdl>{trunc((%initval1%)-(%roundoffset%))+1}

rounds to 1 rather than rounding to 0 which would be the expected outcome. Fix that problem and I'll set you up with 10 rep points.

@EnderFFX
Thank you.
Me too.

hoangvo81
Pro Scripter
Posts: 69
Joined: Tue Feb 07, 2012 8:02 pm

trunc after adding +1

Post by hoangvo81 » Thu Oct 03, 2013 2:33 pm

using hagchr .. reduced form:

Code: Select all

Let>InitVal1=4.85
Let>RoundOffset=0.84
mdl>{trunc((%initval1%)-(%roundoffset%)+1)}
@EnderFFX
me too - these really gets you thinking.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts