Execute SNUSP/Ruby: Difference between revisions

m
Fixed syntax highlighting.
m (→‎Bloated SNUSP: fixed threadring)
m (Fixed syntax highlighting.)
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{implementation|SNUSP}}{{collection|RCSNUSP}}[[Category:Ruby]]
These [[Ruby]] implementations of SNUSP profiles are partially derived from [[RCSNUSP/Tcl]].
With gratitude to [[RCSNUSP/Tcl]]
== =Core SNUSP ===
<langsyntaxhighlight lang="ruby">$stdout.sync = true
$stdin.sync = true
 
Line 183:
puts "done"
 
end</langsyntaxhighlight>
 
Output:
Line 193:
done</pre>
 
== =Modular SNUSP ===
<langsyntaxhighlight lang="ruby">require 'rc_coresnusp.rb'
 
class ModularSNUSP < CoreSNUSP
Line 283:
puts "done"
 
end</langsyntaxhighlight>
Output:
<pre>$ ruby rc_modularsnusp.rb
Line 296:
done</pre>
 
== =Bloated SNUSP ===
User input is still line-oriented -- must press Enter before Ruby sees input.
 
<langsyntaxhighlight lang="ruby">require 'rc_modularsnusp.rb'
 
# here, need input to be non-blocking, so other "threads" can keep working.
Line 486:
puts "done"
 
end</langsyntaxhighlight>
 
Output:
<div style="width:full;overflow:scroll"><pre>$ ruby rc_bloatedsnusp.rb
Bloated: random
3476158785073done
Line 498:
35382407644156390115:505854:46783082311335:4940492329597706::155
2done
</pre></div>
9,476

edits