Lssg97 wrote: ↑March 6th, 2020, 5:18 amOnce I even used Shape Mater to draw a picture myself to remove the picture files in the folder!
Wow, that's really good looking. Never imagined one could actually do this with shapes...
Lssg97 wrote: ↑March 6th, 2020, 4:07 amYou're right, negative numbers can be represented in two's complement for binary. And octal or hexadecimal can use binary conversion directly. As for the other bases, I honestly can't imagine how to represent negative numbers.
I see. So it's all based on binary and two's complement. I guess the "inversion" of the binary could be done easily in regex, the addition of 1 could be trickier though. I was curious in regard to the complexity of the conversion process for negative numbers, so thanks for the info. Lua is probably best suited for this, if you need negative number conversion. If you only try to convert positive numbers, either way (through Rainmeter code or Lua) is just as simple.
Haha, I already checked that, but for a different reason. Great looking piece of art, and a beautiful / inspirational "gift" for jsmorley!
By the way, he should have told you to make all that in Lua, instead of "torturing" yourself in Rainmeter code like this...
Yes, I know you used a couple of tools to simplify the job, but still ... how could you do this without Lua, huh Brian? Just joking, of course. Nice job!
Yincognito wrote: ↑March 5th, 2020, 11:50 pm
By the way, in your sample 111 becomes 111st, which is incorrect, as it's 111th (one hundred and eleventh), same for numbers ending in 12 or 13.
Right, my bad, however jsmorley's solution looks same way incorrect, isn't it? At least for me it seems to give the same sufix for those numbers as mine.
balala wrote: ↑March 6th, 2020, 4:51 pm
Right, my bad, however jsmorley's solution looks same way incorrect, isn't it? At least for me it seems to give the same sufix for those numbers as mine.
"protects" from such a result, but I guess you're right: for num = 111, n = 111 % 10 = 1, and num - n = 111 - 1 = 110 (and not 11 and such, to be able to cover the exception). I think setting n = num % 100 and then testing for n > 10 and n < 20 should solve this. I didn't test the code, but from my (modest) programming intuition, it should do it...
EDIT: But then the other conditions below would fail , since n needs to be num % 10 for the following tests. Anyway, the solution is trivial, I'm sure of it. Like modifying the above into if (num - n) % 100 == 10 then suffix = 'th'. Damn, I just wrote my first Lua line of code!
balala wrote: ↑March 6th, 2020, 6:30 pm
Yep, it does. Your substitution look promising and it does work well, at least as far as I tested it.
No, I meant the replacement in jsmorley's Lua code, i.e. if (num - n) % 100 == 10 then suffix = 'th'. I'm curious if this works, because I already know that my regex substitute does the job.
Yincognito wrote: ↑March 6th, 2020, 6:39 pm
No, I meant the replacement in jsmorley's Lua code, i.e. if (num - n) % 100 == 10 then suffix = 'th'. I'm curious if this works, because I already know that my regex substitute does the job.