Re: [Jprogramming] sequential machine

2014-12-29 Thread Raul Miller
Sequential machine does not support empty tokens. Also, sequential machine does not support deleting characters from inside a token. You can work around those issues but post-processing, but if you have the necessary representation of the sequence to do that kind of post-processing you don't real

[Jprogramming] sequential machine

2014-12-29 Thread David Lambert
^ escapes to the next character, | separates tokens. Can tokenize be written as an application of sequential machine? tokenize 'one^|uno||three|four^^^|^cuatro|' +---++---+++ |one|uno||three^^|four^|cuatro|| +---++---+++ ---

Re: [Jprogramming] Repeated rolling dice

2014-12-29 Thread Björn Helgason
So you mean 9813 is the white queen? On 29 Dec 2014 19:43, "'Pascal Jasmin' via Programming" < programm...@jsoftware.com> wrote: > the queen appears wrong as it is supposed to be in 4th column from the > left. > > > - Original Message - > From: Björn Helgason > To: Programming forum > Cc

Re: [Jprogramming] variable integer coding (challenge)

2014-12-29 Thread 'Pascal Jasmin' via Programming
Here is a useful set of utilities for working with variable length strings/lists packed in a variable (or row) without boxes. One reason to do such packing is that strings take much less memory than other lists , and much less memory than boxes, together with faster general operations. The con

Re: [Jprogramming] Repeated rolling dice

2014-12-29 Thread 'Pascal Jasmin' via Programming
the queen appears wrong as it is supposed to be in 4th column from the left. - Original Message - From: Björn Helgason To: Programming forum Cc: Sent: Monday, December 29, 2014 2:34 PM Subject: Re: [Jprogramming] Repeated rolling dice I discovered the dice unicode while looking for th

Re: [Jprogramming] Repeated rolling dice

2014-12-29 Thread Björn Helgason
I discovered the dice unicode while looking for the chess pieces. I found them close by. I am not sure if I am displaying the correct unicodes for the queen and king: 8 8$ u: (|.(8$9823),9820 9822 9821 9819 9818 9821 9822 9820),(32$32),(8$9817),9814 9816 9815 9812 9813 9815 9816 9814 ♜♞♝♚♛♝♞♜

Re: [Jprogramming] variable integer coding (challenge)

2014-12-29 Thread 'Pascal Jasmin' via Programming
Nice Raul, thank you. Your toVint is 10x faster than mine. my less pretty fromVint fromVbyte=: [: +/&> (255 &>) (<;.2) ] The neat part of the challenge is seeing how dyadic ;. is frequently an elegant alternative to "I might need a loop for this" Your use of #: to make records (rows) is quite

Re: [Jprogramming] variable integer coding (challenge)

2014-12-29 Thread Raul Miller
Here's a faster version of toVint, for at least some right arguments: toVint2=: [: (({."1 ,. 1:) #&, 255 ,. {:"1) 0 255 #: ] Here's an implementation of fromVint: fromVint=: 255&~: +/;.2 ] Thanks, -- Raul On Mon, Dec 29, 2014 at 12:12 PM, 'Pascal Jasmin' via Programming wrote: > A common d

Re: [Jprogramming] Repeated rolling dice

2014-12-29 Thread Björn Helgason
To display the dice: u: 9856+i. 6 ⚀⚁⚂⚃⚄⚅ u: 9855+5 1 4 1 5 2 2 6 2 4 5 6 1 3 6 2 1 4 4 2 ⚄⚀⚃⚀⚄⚁⚁⚅⚁⚃⚄⚅⚀⚂⚅⚁⚀⚃⚃⚁ On 29 Dec 2014 11:15, "Linda Alvord" wrote: > After reading this thread from September, I couldn't resist an "elementary > school" version, shown twice below: > > > >f=: 13 :'>:?y$6

[Jprogramming] variable integer coding (challenge)

2014-12-29 Thread 'Pascal Jasmin' via Programming
A common design decision is how large to make a field. For many numbers, we think that a byte will be large enough to hold practical values, but one day we will find out that it is not. This is essentially the Y2k problem, or year 2032 issue. A simple variable integer coding (tied to byte ran

Re: [Jprogramming] Repeated rolling dice

2014-12-29 Thread Linda Alvord
After reading this thread from September, I couldn't resist an "elementary school" version, shown twice below: f=: 13 :'>:?y$6' ]A=:f 20 NB. Original rolls 5 1 4 1 5 2 2 6 2 4 5 6 1 3 6 2 1 4 4 2 }:1,6~:A 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1