mr womp womp wrote:
123outerme wrote:
Pieman7373 wrote:
123outerme wrote:
Hey Pieman, do you have a GitHub? If not, you should make one; it makes everything a whole lot easier when sharing and editing code. If you have/get one, post the link in this topic, so I can possibly go and make some edits. If you don't want to make it, not a problem.
I have one... I dont have anything for this on it yet though
https://github.com/Pieman7373/QBSOLVE/tree/master
Okay, I've submitted a pull request that fixes a few things. You can see the full details in the pull request.
mr womp womp wrote:
Code:
"page."+eval(A)+",6x6->Str1
AFAIK, Pieman is using the CSE for this, which doesn't have the eval() function. You could have this instead:
Code:
"page."+sub("0123456789",A-1,1)+",6x6->Str1
Haha, I realised this was in hybrid-basic and therefore not compatible with the CE yet, and therefore he must have been using the CSE, and thus, the eval() command was not available to him. This is why I promptly removed the post, but I guess you had time to quote me on that
As for the code, you have to note that the page number sometimes goes up to double digits, and if we want to keep things in decimal, your method won't work. That is not to say that it won't work entirely, but it won't work for the one case where the page number goes up to 10. Therefore, we will have to go with the perpetual thorn or the longer, less popular method which is only really an option if we're dealing with integers, which we are. I've thus decided to list out the two sensible ways it could be done (and work for page 10 too).
The nice way
Code:
"?
For(B,1,1+log(A
sub("0123456789",iPart(10fPart(A10^(~B)))+1,1)+Ans
End
"page."+sub(Ans,1,length(Ans)-1)+",6x6→Str1
The ugly (but smaller) way that overwrites a lot more variables
Code:
{0,1→L₁
{0,A→L₂
LinReg(ax+b) Y₁
Equ►String(Y₁,Str1
"page."+sub(Str1,1,length(Str1)-3)+",6x6→Str1
Yeah, you're right, to have more free control over what A can be, your methods are better. I even used the 2nd one (because it supported decimals) for saving in Sorcery of Uvutu. But if he has one or two digits for his pages (page 0 - 99, essentially), then my method might be more desirable. For two digits, I would do:
Code:
"page."+sub("000102030405060708091011121314151617181920",2A-2,2)+",6x6->Str1
But again, those methods aren't wrong, I just prefer it this way, personally.