-
Notifications
You must be signed in to change notification settings - Fork 1
/
fifty-percent-nullify.fs
32 lines (24 loc) · 799 Bytes
/
fifty-percent-nullify.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\ galope/fifty-percent-nullify.fs
\ This file is part of Galope
\ http:https://programandala.net/en.program.galope.html
\ Author: Marcos Cruz (programandala.net), 2016.
\ ==============================================================
require random.fs \ Gforth's `random`
: 50%nullify ( x -- x | 0 ) 2 random * ;
\ doc{
\
\ 50%nullify ( x -- x | 0 )
\
\ Randomly return zero instead of _x_, 50% choices.
\ Faster and smaller than ``50 %nullify``.
\
\ See: `%nullify`, `?nullify`.
\
\ }doc
\ ==============================================================
\ Change log
\ 2016-07-19: Move `s?` from the deprecated module <sb.fs> and rename
\ it. More general versions have been written as `?nullify` and
\ `%nullify` in their own modules.
\
\ 2018-07-24: Improve documentation.