User talk:PureFox: Difference between revisions

 
(17 intermediate revisions by 8 users not shown)
Line 202:
 
::Great. I will delete the pages when told. Thanks a lot. (I just thought that if another language were doing similar...) 👍--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 02:54, 25 May 2020 (UTC)
 
:::Phew! Done all that so the old pages (and their associated talk pages) can now be safely deleted.
 
:::Here's a list so you can easily find them:
:::* [[https://rosettacode.org/wiki/Category:Fmt fmt]]
:::* [[https://rosettacode.org/wiki/Category:Str str]]
:::* [[https://rosettacode.org/wiki/Category:Sort sort]]
 
:::Although it doesn't really matter, I decided in the end to use a prefix of 'Wren-' rather than 'Wren/' as I wanted to keep the module name lower case (the convention in Wren) and I thought it just looked better :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 11:14, 25 May 2020 (UTC)
 
::::Incidentally, I realize that using the 'Wren-" prefix means the modules won't show up as Wren sub-categories though that's good, AFAIC, as I'd prefer people to think of them as libraries rather than sub-categories. Even better they shouldn't show up in the count of tasks completed in [[Rosetta Code/Rank languages by popularity]] which, of course, they're not.--[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 13:14, 25 May 2020 (UTC)
 
 
== Isqrt (integer square root) of X‎‎ ==
 
Thanks for speedily updating those two computer programs and output   (by just using the '''odd''' powers of seven).   I had overlooked the omission of that word, and I didn't realize until I saw a couple of outputs, and I wondered why are those output sections so large?   When I'm in a hurry and scroll too fast and I can overlook what I'm scrolling through.   Thanks to your speedy updates,   I could remove the pink ''Noticebox'' fairly quickly.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 11:38, 16 July 2020 (UTC)
 
:No problem, Gerard, just a minor alteration was needed. Incidentally, I'm glad this task came up as it reminded me that I needed to add an integer square root method to my Wren BigInt class. This algorithm looks ideal as it's non-recursive, uses only integer arithmetic and is reasonably fast so I'm going to look at adding that today. Thanks. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 14:19, 16 July 2020 (UTC)
 
== Primes which sum of digits is 25 ==
 
Just a small comment, to figure out, how slow an AMD 2200G is.
Your go version takes <pre> go version go1.16.2 linux/amd64 (installed today)
There are 1,525,142 primes whose digits sum to 25 and include no zeros.
 
Took 31.330058446s
 
only counting
if rem == 0 {
res++
/*
b := p[len(p)-1]
if b == '1' || b == '3' || b == '7' || b == '9' {
z := new(big.Int)
z.SetString(p, 10)
if z.ProbablyPrime(1) {
res++
}
}*/
} else {
There are 16,499,120 primes whose digits sum to 25 and include no zeros.
 
Took 4.980341373s</pre>
I couldn't compile the cpp version.<BR>I only wanted to know, if generating the possible combinations = 1291 and than create the permutations could be faster for generating the numbers. [[user:horsth|Horsth]] 17:55, 29 March 2021 (UTC)
 
:On a 'counting only' basis, the Go example runs in about 3.7 seconds on my machine which is an Intel Core i7-8565U.
 
:The C++ example should compile with a line such as this: g++ -std=c++11 -O3 sum25.cpp -lgmp -o sum25. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 18:23, 29 March 2021 (UTC)
 
== Disagreement on 9 (and 7) digit palindromic products ==
 
Hi, in the [[Largest palindrome product]] task, Go and Raku disagree.
 
7 digit:
<pre>Go: 9999979 x 9467731 = 94677111177649
Raku: 9997647 × 9998017 = 99956644665999</pre>
 
9 digit:
<pre>Go: 999999969 × 998396971 = 998396940049693899
Raku: 999920317 × 999980347 = 999900665566009999</pre>
 
So one of them needs to be tweaked. I've double and triple checked Raku so I believe that it has the ''actual'' largest palindromic product. Regards --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 13:28, 3 November 2021 (UTC)
 
: Go seems to be prioritizing keeping the multiplicand as high as possible, while not checking more balanced combinations. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 13:43, 3 November 2021 (UTC)
 
::Sorry, you're both right - the original Wren (and hence Go) solutions were wrong and it was just by good fortune that they were giving the right answers for N <= 6. However, I've corrected them and the results for N = 7, 8 and 9 now agree with the Raku solution. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 16:19, 3 November 2021 (UTC)
 
== problems with trait.wren ==
 
Hi;
 
I'm learning Wren by reading the Rosetta Code web site containing task solved using Wren. I copy the code and run it on my computer where I have installed Wren. The tasks written not using the extra Rosetta Code Wren libraries works great. All of the extra Rosetta Code Wren libraries that need trait.wren fail with the following errors:
 
an example...
 
ren_cli 15_puzzle_game_solver.wren
[../RC_Wren_Lib/trait line 108] Error at 'class': Expect method definition.
[../RC_Wren_Lib/trait line 108] Error at 'Const': Expect end of file.
Could not compile module '../RC_Wren_Lib/trait'.
[../RC_Wren_Lib/long line 3] in (script)
[./15_puzzle_game_solver line 1] in (script)
 
I've tried very carefully to copy&paste the trait.wren code and the same error occurs.
 
I have copy&pasted several (obviously not all!) of the Rosetta Code Wren libraries and this is the only one that I have problems with so far.
 
I have successfully run many of the Rosetta Code Wren examples and am slowly learning a new computer language!
 
Thanks,
Retired_Build_Engineer
 
:Hi and welcome to Rosetta Code!
 
:I've made quite a few changes to Wren-trait lately and the problem is that I've somehow managed to lose the closing brace at the end of the ByKey class when updating the RC copy. Sorry about that but I've fixed it now so it should work OK.
 
:Incidentally, in some of the earlier examples you'll find that I've been importing modules like this: import "/fmt". This works fine on Linux (which I use) but may not work on Windows or MacOs due to a glitch in how Wren-cli is currently written. If you find that's the case, then just precede the module reference with a dot: import "./fmt" and it should work.
 
:Thanks for taking an interest in Wren which I think you'll agree is a nice little language and surprisingly stable given that we're not yet at version 1.0. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 08:42, 31 August 2023 (UTC)
 
Thank you for the updated trait.wren; it seems to have resolved all the problems I experienced with that library. There are a few new things that I've noticed, but in general, this is awesome!
 
Thanks,
Retired_Build_Engineer
 
== Wren Syntax Highlighting ==
 
Hi PureFox,
 
I ran an old script looking for <code>syntaxhighlight lang="ecmascript"</code> and found these. Most are where the Wren entry has multiple code blocks.
 
'''Tasks'''
 
* [[Associative array/Merging]]
* [[Currying]]
* [[Determine sentence type]]
* [[Grayscale image]]
* [[Map range]]
* [[Make directory path]]
 
'''Drafts'''
 
* [[Conjugate a Latin verb]]
* [[Exactly three adjacent 3 in lists]]
 
'''Talk'''
 
* [[Talk:Code Golf: Code Golf]]
* [[Talk:Statistics/Chi-squared distribution]]
 
I'd be happy to change these to <code>lang="wren"</code> if you're fed up with it.
 
Cheers,
James
 
--[[User:Jgrprior|Jgrprior]] ([[User talk:Jgrprior|talk]]) 16:57, 17 February 2024 (UTC)
 
:Hi James,
:Thanks very much for finding these stragglers :)
:I'm not surprised I've missed some as it's an awful job trying to maintain concentration when doing something like this manually.
:Fed up with it as I am, as it's my baby, I think I'd better finish the job myself.
:Thanks again. [[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 18:32, 17 February 2024 (UTC)
9,476

edits