Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread emacstheviking
Yes, Bjorn! Back in the day, when I work on a Vax 11/780 the walk to the printer room and back usually solved the issue. These days it is called Yoda programming I think but I know it as 'Cardboard Programmer' syndrome, when talking to a cardboard cut-out quite often suffices. On Wed, 23 Dec 202

Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread Björn Helgason
In general trying to explain something you are trying to solve to someone often makes you see the solution even if that somone does not understand what you are talking about. Þann mið., 23. des. 2020, 15:23 emacstheviking skrifaði : > Henry, > > Yes I managed to figure it out myself in between em

Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread emacstheviking
Henry, Yes I managed to figure it out myself in between emails! Funny how sending an email somehow brings things to light... but about 2 femtoseconds after pressing Send. Thank you very much. J continues to both delight me and mentally destroy me . On Wed, 23 Dec 2020 at 15:02, Henry Rich w

Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread Henry Rich
Order of evaluation is right to left.  These are all monads. ?2, ?100, ?100 ?2, ? 100 , rand0 If rand0 is 0 the next ? will return a float. Henry Rich On 12/23/2020 9:39 AM, emacstheviking wrote: Henry, I am not exactly sure what you mean but after posting I spotted that I was assigning typ

Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread emacstheviking
Henry, I am not exactly sure what you mean but after posting I spotted that I was assigning type to a random value then using that as the argument to roll, I fixed that. If you start a jconsole session and type ?2, ?100, ?100 sooner or later you get a float... placing parens. around it (?2), (?

Re: [Jprogramming] Random numbers not as expected

2020-12-23 Thread Henry Rich
Are you SURE that value of stargen matches the printed results? Henry Rich On 12/23/2020 9:14 AM, emacstheviking wrote: I am confused as to why trying to return a list of random numbers produces floating point values now and then, seemingly random! :D Passing >0 is, as I understand it, a half-o

[Jprogramming] Random numbers not as expected

2020-12-23 Thread emacstheviking
I am confused as to why trying to return a list of random numbers produces floating point values now and then, seemingly random! :D Passing >0 is, as I understand it, a half-open interval, as an integer so why the floats? stargen=: 3 : 0 'maxx maxy'=.y smoutput 'maxx:',(":maxx),' maxy:',(":maxy) t

Re: [Jprogramming] Random Numbers

2017-10-29 Thread Raul Miller
Only if the definition is active. Thanks, -- Raul On Sun, Oct 29, 2017 at 8:20 PM, Devon McCormick wrote: > For an individual name, you could use "whereDefined" to good effect: > >whereDefined=: 3 : '(4!:4{.;:y) {:: (4!:3),<''Source of definition > not found for '',''.'',~y' >wher

Re: [Jprogramming] Random Numbers

2017-10-29 Thread Devon McCormick
For an individual name, you could use "whereDefined" to good effect: whereDefined=: 3 : '(4!:4{.;:y) {:: (4!:3),<''Source of definition not found for '',''.'',~y' whereDefined 'calendar' E:\Users\DevonMcC\j64-804\system\main\stdlib.ijs whereDefined 'calendar_z_' E:\Users\DevonMcC\j64-

Re: [Jprogramming] Random Numbers

2017-10-29 Thread Raul Miller
Well... I suppose you could do what I do: (1) Have cygwin.com's system installed. (Need to pick 32 or 64 bit as appropriate for your version of windows - probably the 64 bit version. You do not need any of the optional packages.) (2) Start up a cygwin shell. The command structure is a bit differe

Re: [Jprogramming] Random Numbers

2017-10-29 Thread 'Skip Cave' via Programming
Bob, Thanks for the tip. It would be nice if there was a packages table of contents on the Jsoftware.com website, with links to each package as well as links to all the defined verbs in each package. Then one could track down useful verbs using the Jsoftware.com website search bar. Perhaps having

Re: [Jprogramming] Random Numbers

2017-10-29 Thread robert therriault
Hi Skip, I did a search with the finder on my mac for the text "rand11=" and those were two of the files that were shown to contain it. It is the trick that I use to find the origins of verbs that don't show up in the usual ways. Cheers, bob > On Oct 29, 2017, at 12:23 AM, 'Skip Cave' via Prog

Re: [Jprogramming] Random Numbers

2017-10-29 Thread 'Skip Cave' via Programming
Bob, thanks for the link. I searched the jsoftware.com website for the rand11 verb, and none of the hits showed the code, or what package the function might be in. I just found a brief description, with no indication what package the verb might be in: rand11 random

Re: [Jprogramming] Random Numbers

2017-10-28 Thread robert therriault
I found it in j602 in this path ~/j602/system/packages/stats/random.ijs setrl=: 9!:1 deal=: (# ? #) : (? #) { ] dealx=: ] #: ?~ : ? & (*/) toss=: ? @ (# #) { ] tossx=: ] #: (?@# */) rand01=: ?@$ 0: rand11=: <: @: +: @: rand01 and it remains in the newest version of the j beta ~/j64-806/addons/s

[Jprogramming] Random Numbers

2017-10-28 Thread 'Skip Cave' via Programming
I found this verb description in the Jsoftware website" rand11 random v generate y random numbers in interval (_1,1) ​Bu I can't find ​the actual code implementing the rand11 function anywhere on the Jsoftware site. Can anyone point m