3 ms·
s and f are different conditions s=success f=failure default is unconditional Is bitwise OR a built-in or would it require writing a separate function
by 1vuio0pswjnm7 5y ago
s and f are different conditions
s=success
f=failure
default is unconditional
Is bitwise OR a built-in or would it require writing a separate function.
- thaumasiotes 5y agoBased on the documentation, there do not appear to be any bitwise operations available in SNOBOL. It looks like computing x as remdr(3) + remdr(5) is a pure mistake. You only care about the case where remdr(15) is 0, and it's true that remdr(3) + remdr(5) is 0 if and only if remdr(15) is 0. But you're calling remdr twice where you should only be calling it once. (Or, really, you can keep the weird calculation of remdr(3) + remdr(5), which is conceptually incorrect but correct in every case that matters, but stop computing it with two extra calls to remdr. You're already calculating those values and storing them in the variables y and z; compute x as y + z, which must be much faster than calling remdr two additional times.) As a side note, why do you want to use "a language for non-numeric computation" for this purely numeric problem?
- 1vuio0pswjnm7 5y agoI think the term "non-numeric" probably refers to another popular language of the era from which SNOBOL comes called FORTRAN. The purpose of fizzbuzz as I understand it is to test a person's aptitude for programming, but not necessarily a person's ability to select the "right" programming language. If the purpose of fizbuzz is to test for programming language selection, and fizzbuzz is a "purely numeric problem", then should the proper choice be FORTRAN.