Pernicious numbers: Difference between revisions

Add Plain English
(Added Wren)
(Add Plain English)
Line 1,729:
<pre>3 5 6 7 9 10 11 12 13 14 17 18 19 20 21 22 24 25 26 28 31 33 34 35 36
888888877 888888878 888888880 888888883 888888885 888888886 888888889 888888890 888888892 888888897 888888898 888888900
</pre>
 
=={{header|Plain English}}==
<lang plainenglish>To decide if a number is pernicious:
Find a population count of the number.
If the population count is prime, say yes.
Say no.
 
To find a population count of a number:
Privatize the number.
Loop.
If the number is 0, exit.
Bitwise and the number with the number minus 1.
Bump the population count.
Repeat.
 
To run:
Start up.
Show the first twenty-five pernicious numbers.
Show the pernicious numbers between 888888877 and 888888888.
Wait for the escape key.
Shut down.
 
To show the first twenty-five pernicious numbers:
Put 0 into a number.
Put 0 into a pernicious number count.
Loop.
If the pernicious number count is greater than 24, write "" on the console; exit.
If the number is pernicious, show the number; bump the pernicious number count.
Bump the number.
Repeat.
 
To show a number:
Convert the number to a string.
Write the string then " " on the console without advancing.
 
To show the pernicious numbers between a number and another number:
Privatize the number.
Subtract 1 from the number.
Loop.
If the number is past the other number, exit.
If the number is pernicious, show the number.
Repeat.</lang>
{{out}}
<pre>
3 5 6 7 9 10 11 12 13 14 17 18 19 20 21 22 24 25 26 28 31 33 34 35 36
888888877 888888878 888888880 888888883 888888885 888888886
</pre>
 
1,808

edits