User talk:Wamba: Difference between revisions

(Yep!)
 
(2 intermediate revisions by one other user not shown)
Line 5:
 
::many thanks Wamba. That's brill. Usually I manage to get the explanation into the incorrect message banner, but when you go to greater lengths and have code like you have, then it's best to put it in the talk page. Thanks again! --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 23:23, 24 June 2015 (UTC)
 
== Markov chain text generator ==
 
Really good to get 'rotor' back into the Perl 6 solution, a definite improvement over the fix I made.
But I think two details need to be taken care of:<br>
• @prefix should contain strings, not lists (eg "Alice was" not ("Alice", "was")<br>
• the routine needs to explicitly return a hash
 
So something along the lines of:
<pre>my @prefix.push: .join(' ') for @words.rotor: $n => -$n+1;
(%).push: @prefix Z=> @words[$n .. *];
</pre>
 
--[[User:SqrtNegInf|SqrtNegInf]] ([[User talk:SqrtNegInf|talk]]) 17:08, 5 February 2017 (UTC)
 
:Hi, first item is no problem because ( <code>"Alice was" eq ("Alice", "was")</code> ). Secondly, <code>push</code> is needed and It does not work rigth without. Thank you SqrtNegInf .
:--[[User:Wamba|Wamba]] ([[User talk:Wamba|talk]]) 12:49, 6 February 2017 (UTC)
Anonymous user