Base 16 numbers needing a to f: Difference between revisions

m
syntax highlighting fixup automation
(Added Arturo implementation)
m (syntax highlighting fixup automation)
Line 8:
{{trans|Nim}}
 
<langsyntaxhighlight lang=11l>V l = (0..500).filter(n -> !hex(n).is_digit())
 
print(‘Found ’l.len" numbers between 0 and 500:\n")
L(n) l
print(‘#3’.format(n), end' I (L.index + 1) % 19 == 0 {"\n"} E ‘ ’)
print()</langsyntaxhighlight>
 
{{out}}
Line 37:
</pre>
=={{header|68000 Assembly}}==
<langsyntaxhighlight lang=68000devpac>MOVEQ #0,D0 ;clear D0
MOVEM.L D0,D1-D6 ;clear data regs
 
Line 90:
RTS
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</langsyntaxhighlight>
 
=={{header|Action!}}==
<langsyntaxhighlight lang=Action!>BYTE FUNC IsHexWithLetter(INT x)
DO
IF x MOD 16>9 THEN
Line 115:
OD
PrintF("%E%EFound %I numbers between %I and %I",count,min,max)
RETURN</langsyntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Base_16_numbers_needing_a_to_f.png Screenshot from Atari 8-bit computer]
Line 134:
 
=={{header|Ada}}==
<langsyntaxhighlight lang=Ada>with Ada.Text_Io;
 
procedure Base_16_Numbers is
Line 167:
New_Line (2);
Put ("Total count: "); Natural_Io.Put (Count, Width => 3); New_Line;
end Base_16_Numbers;</langsyntaxhighlight>
{{out}}
<pre> 10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59 60 61 62 63
Line 186:
 
=={{header|ALGOL 68}}==
<langsyntaxhighlight lang=algol68>BEGIN # show numbers that when represented in hex, have at least one a-f digit #
INT h count := 0;
FOR i TO 500 DO
Line 200:
OD
OD
END</langsyntaxhighlight>
{{out}}
<pre>
Line 222:
 
=={{header|ALGOL W}}==
<langsyntaxhighlight lang=algolw>% show numbers that when represented in hex, have at least one a-f digit %
begin
integer hCount;
Line 241:
end while_v_gt_0
end for_i
end.</langsyntaxhighlight>
{{out}}
<pre>
Line 264:
=={{header|APL}}==
{{works with|Dyalog APL}}
<langsyntaxhighlight lang=APL>(⊢(/⍨)(10∨.≤16(⊥⍣¯1)⊢)¨)⍳500</langsyntaxhighlight>
{{out}}
<pre>10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59 60 61 62 63
Line 288:
=={{header|AppleScript}}==
===Procedural===
<langsyntaxhighlight lang=applescript>local output, n, x, ding
set output to {}
repeat with n from 0 to 500
Line 299:
if (ding) then set end of output to n
end repeat
return output</langsyntaxhighlight>
 
{{output}}
<langsyntaxhighlight lang=applescript>{10, 11, 12, 13, 14, 15, 26, 27, 28, 29, 30, 31, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 74, 75, 76, 77, 78, 79, 90, 91, 92, 93, 94, 95, 106, 107, 108, 109, 110, 111, 122, 123, 124, 125, 126, 127, 138, 139, 140, 141, 142, 143, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 266, 267, 268, 269, 270, 271, 282, 283, 284, 285, 286, 287, 298, 299, 300, 301, 302, 303, 314, 315, 316, 317, 318, 319, 330, 331, 332, 333, 334, 335, 346, 347, 348, 349, 350, 351, 362, 363, 364, 365, 366, 367, 378, 379, 380, 381, 382, 383, 394, 395, 396, 397, 398, 399, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500}</langsyntaxhighlight>
 
===Functional===
Defining a simple predicate, and composing a test with formatted output from a set of generic functions:
<langsyntaxhighlight lang=applescript>-------- INTEGERS NEEDING HEX DIGITS HIGHER THAN 9 -------
 
-- p :: Int -> Bool
Line 506:
end repeat
v
end |until|</langsyntaxhighlight>
{{Out}}
<pre>301 matches for the predicate:
Line 564:
=={{header|Arturo}}==
 
<langsyntaxhighlight lang=rebol>needsAF?: function [x][
hex: as.hex x
loop `a`..`f` 'c [
Line 573:
]
 
print select 0..500 => needsAF?</langsyntaxhighlight>
 
{{out}}
Line 580:
 
=={{header|AWK}}==
<langsyntaxhighlight lang=AWK>
# syntax: GAWK -f BASE-16_REPRESENTATION.AWK
BEGIN {
Line 593:
exit(0)
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 616:
 
=={{header|BASIC}}==
<langsyntaxhighlight lang=basic>10 DEFINT I,J
20 FOR I=1 TO 500
30 J=I
40 IF (J AND 15)>=10 THEN PRINT I, ELSE J=J/16: IF J>9 THEN 40
50 NEXT I</langsyntaxhighlight>
{{out}}
<pre style='height:50ex'> 10 11 12 13 14
Line 686:
 
=={{header|BASIC256}}==
<langsyntaxhighlight lang=qbasic>function needs_af (n)
while n > 0
if (n % 16) > 9 then return true
Line 697:
if needs_af(i) then print i; " ";
next i
end</langsyntaxhighlight>
 
 
=={{header|BCPL}}==
<langsyntaxhighlight lang=bcpl>get "libhdr"
 
let nondec(x) =
Line 717:
$)
wrch('*N')
$)</langsyntaxhighlight>
{{out}}
<pre> 10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59
Line 737:
 
=={{header|C++}}==
<langsyntaxhighlight lang=cpp>#include <iomanip>
#include <iostream>
 
Line 759:
}
std::cout << "\n\n" << count << " such numbers found.\n";
}</langsyntaxhighlight>
 
{{out}}
Line 789:
 
=={{header|CLU}}==
<langsyntaxhighlight lang=clu>nondec = proc (x: int) returns (bool)
while x>9 do
if x//16>=10 then return(true) end
Line 808:
end
stream$putl(po, "\nFound " || int$unparse(count) || " numbers.")
end start_up</langsyntaxhighlight>
{{out}}
<pre> 10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59
Line 829:
 
=={{header|COBOL}}==
<langsyntaxhighlight lang=cobol> IDENTIFICATION DIVISION.
PROGRAM-ID. BASE-16.
Line 883:
ELSE
MOVE N16 TO NTEMP
GO TO IS-NONDEC.</langsyntaxhighlight>
{{out}}
<pre> 10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47
Line 906:
 
=={{header|Cowgol}}==
<langsyntaxhighlight lang=cowgol>include "cowgol.coh";
 
sub nondecimal(n: uint16): (r: uint8) is
Line 935:
i := i + 1;
end loop;
print_nl();</langsyntaxhighlight>
{{out}}
<pre>10 11 12 13 14 15 26 27 28 29
Line 970:
 
=={{header|F_Sharp|F#}}==
<langsyntaxhighlight lang=fsharp>
// Base 16 representation: Nigel Galloway. June 3rd., 2021
let rec fN g=match g%16,g/16 with (n,0)->9<n |(n,g) when n<10->fN g |_->true
seq{1..500}|>Seq.filter fN|>Seq.iter(printf "%d "); printfn ""
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 984:
 
{{works with|Factor|0.99 2021-02-05}}
<langsyntaxhighlight lang=factor>USING: combinators formatting grouping io kernel lists
lists.lazy math prettyprint sequences ;
 
Line 998:
1 lfrom [ non-decimal? ] lfilter [ 501 < ] lwhile
list>array dup 15 group [ [ "%3d " printf ] each nl ] each nl
length pprint " such numbers found." print</langsyntaxhighlight>
{{out}}
<pre>
Line 1,027:
 
=={{header|FOCAL}}==
<langsyntaxhighlight lang=FOCAL>01.10 S C=0
01.20 F N=1,500;D 2
01.30 T !
Line 1,041:
02.80 S C=C+1
02.90 I (C-10)2.99;T !;S C=0
02.99 R</langsyntaxhighlight>
{{out}}
<pre>= 10= 11= 12= 13= 14= 15= 26= 27= 28= 29
Line 1,077:
=={{header|Forth}}==
{{works with|Gforth}}
<langsyntaxhighlight lang=forth>\ Returns true if the hexadecimal representation of n contains at least one
\ non-decimal digit.
: non-decimal ( u -- ? )
Line 1,102:
 
main
bye</langsyntaxhighlight>
 
{{out}}
Line 1,132:
 
=={{header|FreeBASIC}}==
<langsyntaxhighlight lang=freebasic>function needs_af( byval n as uinteger ) as boolean
while n>0
if n mod 16 > 9 then return true
Line 1,143:
if needs_af(i) then print i;" ";
next i
</syntaxhighlight>
</lang>
{{out}}<pre>
10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59 60 61 62 63 74 75 76 77 78 79 90 91 92 93 94 95 106 107 108 109 110 111 122 123 124 125 126 127 138 139 140 141 142 143 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 266 267 268 269 270 271 282 283 284 285 286 287 298 299 300 301 302 303 314 315 316 317 318 319 330 331 332 333 334 335 346 347 348 349 350 351 362 363 364 365 366 367 378 379 380 381 382 383 394 395 396 397 398 399 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
Line 1,149:
 
=={{header|Frink}}==
<langsyntaxhighlight lang=frink>select[1 to 500, {|n| base16[n] =~ %r/[a-f]/i}]</langsyntaxhighlight>
{{out}}
<pre>
Line 1,157:
=={{header|Go}}==
{{trans|Wren}}
<langsyntaxhighlight lang=go>package main
 
import (
Line 1,179:
}
fmt.Printf("\n\n%d such numbers found.\n", c)
}</langsyntaxhighlight>
 
{{out}}
Line 1,209:
 
=={{header|Haskell}}==
<langsyntaxhighlight lang=haskell>import Data.List (intercalate, transpose)
import Data.List.Split (chunksOf)
import Text.Printf (printf)
Line 1,254:
 
justifyRight :: Int -> Char -> String -> String
justifyRight n c = (drop . length) <*> (replicate n c <>)</langsyntaxhighlight>
{{Out}}
<pre>301 matches up to 500:
Line 1,281:
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang=javascript>(() => {
"use strict";
 
Line 1,464:
// MAIN ---
return main();
})();</langsyntaxhighlight>
{{Out}}
<pre>301 matches up to 500:
Line 1,523:
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
<syntaxhighlight lang=jq>
<lang jq>
# decimal number to hex string using lower-case letters
def hex:
Line 1,549:
;
task
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 1,586:
 
=={{header|Julia}}==
<langsyntaxhighlight lang=julia>usesletters = filter(n -> begin s = string(n, base = 16); any(c -> c in s, collect("abcdef")) end, 1:500)
 
foreach(p -> print(rpad(p[2], 4), p[1] % 15 == 0 ? "\n" : ""), enumerate(usesletters))
</langsyntaxhighlight>{{out}}
<pre>
10 11 12 13 14 15 26 27 28 29 30 31 42 43 44
Line 1,615:
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<langsyntaxhighlight lang=Mathematica>Select[Range[500], AnyTrue[IntegerDigits[#, 16], GreaterEqualThan[10]] &]</langsyntaxhighlight>
{{out}}
<pre>{10, 11, 12, 13, 14, 15, 26, 27, 28, 29, 30, 31, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 74, 75, 76, 77, 78, 79, 90, 91, 92, 93, 94, 95, 106, 107, 108, 109, 110, 111, 122, 123, 124, 125, 126, 127, 138, 139, 140, 141, 142, 143, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 266, 267, 268, 269, 270, 271, 282, 283, 284, 285, 286, 287, 298, 299, 300, 301, 302, 303, 314, 315, 316, 317, 318, 319, 330, 331, 332, 333, 334, 335, 346, 347, 348, 349, 350, 351, 362, 363, 364, 365, 366, 367, 378, 379, 380, 381, 382, 383, 394, 395, 396, 397, 398, 399, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500}</pre>
 
=={{header|Modula-2}}==
<langsyntaxhighlight lang=modula2>MODULE NonDecimal;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
 
Line 1,654:
WriteString(" numbers found.");
WriteLn;
END NonDecimal.</langsyntaxhighlight>
{{out}}
<pre> 10 11 12 13 14 15 26 27 28 29 30 31 42 43 44 45 46 47 58 59
Line 1,676:
 
=={{header|Nim}}==
<langsyntaxhighlight lang=Nim>import strutils, sugar
 
let list = collect(newSeq):
Line 1,685:
for i, n in list:
stdout.write ($n).align(3), if (i + 1) mod 19 == 0: '\n' else: ' '
echo()</langsyntaxhighlight>
 
{{out}}
Line 1,708:
 
=={{header|Perl}}==
<langsyntaxhighlight lang=perl>#!/usr/bin/perl
 
use strict; # https://rosettacode.org/wiki/Base-16_representation
Line 1,714:
 
print join( ' ', grep sprintf("%x", $_) =~ tr/a-z//, 1 .. 500 ) =~
s/.{71}\K /\n/gr, "\n";</langsyntaxhighlight>
{{out}}
<pre>
Line 1,738:
 
=={{header|Phix}}==
<!--<langsyntaxhighlight lang=Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">above9</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">n</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">return</span> <span style="color: #7060A8;">max</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%x"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">n</span><span style="color: #0000FF;">))></span><span style="color: #008000;">'9'</span> <span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%s\n"</span><span style="color: #0000FF;">,{</span><span style="color: #7060A8;">join</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">shorten</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">apply</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">filter</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">tagset</span><span style="color: #0000FF;">(</span><span style="color: #000000;">500</span><span style="color: #0000FF;">),</span><span style="color: #000000;">above9</span><span style="color: #0000FF;">),</span><span style="color: #7060A8;">sprint</span><span style="color: #0000FF;">),</span><span style="color: #008000;">"found"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">10</span><span style="color: #0000FF;">))})</span>
<!--</langsyntaxhighlight>-->
{{out}}
<pre>
Line 1,748:
</pre>
{{trans|Raku|someone got their clever hat on there}}
<!--<langsyntaxhighlight lang=Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #7060A8;">requires</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"1.0.0"</span><span style="color: #0000FF;">)</span>
Line 1,768:
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #000000;">fmt</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">thresh</span><span style="color: #0000FF;">,</span><span style="color: #000000;">can</span><span style="color: #0000FF;">,</span><span style="color: #000000;">cannot</span><span style="color: #0000FF;">})</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<!--</langsyntaxhighlight>-->
{{out}}
<pre>
Line 1,782:
 
=={{header|PL/M}}==
<langsyntaxhighlight lang=plm>100H: /* SHOW NUMBERS THAT WHEN REPRESENTED IN HEX, HAVE AT LEAST 1 A-F DIGIT */
/* CP/M BDOS SYSTEM CALL */
BDOS: PROCEDURE( FN, V ); DECLARE FN BYTE, V ADDRESS; GOTO 5; END;
Line 1,825:
END;
END;
EOF</langsyntaxhighlight>
{{out}}
<pre>
Line 1,847:
 
=={{header|Python}}==
<langsyntaxhighlight lang=python>'''Integers needing any alpha digits in hex'''
 
 
Line 1,904:
# MAIN ---
if __name__ == '__main__':
main()</langsyntaxhighlight>
{{Out}}
<pre>301 matches for the predicate:
Line 1,962:
=={{header|Quackery}}==
 
<langsyntaxhighlight lang=Quackery> [ false swap
[ dup 0 != while
16 /mod
Line 1,976:
[ i^ number$
nested join ] ]
60 wrap$</langsyntaxhighlight>
 
{{out}}
Line 2,009:
Base 16 is not hexadecimal. Hexadecimal is ''an implementation'' of base 16.
 
<syntaxhighlight lang=raku perl6lines>use Base::Any;
set-digits <⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ㉑ ㉒ ㉓ ㉔ ㉕>;
say (7**35).&to-base(16);
 
# ⑭㉒⑱⑩⑰⑰⑳⑮⑱⑳⑩⑳⑱㉒㉑⑰㉒⑫⑭⑲⑯⑩㉔⑮⑰</langsyntaxhighlight>
 
How many of those glyphs are decimal digits? And yet it '''is''' in base 16, albeit with non-standard digit glyphs. So they '''all''' can be written without using a hexadecimal digit.
Line 2,022:
Bah. Show which when written in base 16, contain a digit glyph with a value greater than 9:
 
<syntaxhighlight lang=raku perl6lines>put display :20cols, :fmt('%3d'), (^501).grep( { so any |.map: { .polymod(16 xx *) »>» 9 } } );
 
sub display ($list, :$cols = 10, :$fmt = '%6d', :$title = "{+$list} matching:\n" ) {
cache $list;
$title ~ $list.batch($cols)».fmt($fmt).join: "\n"
}</langsyntaxhighlight>
{{out}}
<pre>301 matching:
Line 2,049:
But wait a minute. Let's take another look at the the task title. '''Base-16 representation'''. It isn't talking about Base 16 at all. It's talking about Base'''-16'''... so let's do it in base -16.
 
<syntaxhighlight lang=raku perl6lines>use Base::Any;
 
put display :20cols, :fmt('%3d'), (^501).grep( { .&to-base(-16).contains: /<[A..F]>/ } );
Line 2,056:
cache $list;
$title ~ $list.batch($cols)».fmt($fmt).join: "\n"
}</langsyntaxhighlight>
{{out}}
<pre>306 matching:
Line 2,078:
Of course, if you are looking for the '''count''' of the hexadecimal numbers up to some threshold that only use "decimal" digits, it is silly and counter-productive to iterate through them and check '''''each''''' when you really only need to check '''''one'''''.
 
<syntaxhighlight lang=raku perl6lines>use Lingua::EN::Numbers;
 
for 500
Line 2,096:
 
say '';
}</langsyntaxhighlight>
{{out}}
<pre>Quantity of numbers up to 500 that CAN be expressed in hexadecimal without using any alphabetics: 199
Line 2,112:
=={{header|REXX}}==
REXX automatically uses only uppercase when converting integers to hexadecimal, &nbsp; but the lowercase alphabetic letters were also included for boilerplate code.
<langsyntaxhighlight lang=rexx>/*REXX pgm finds positive integers when shown in hexadecimal require an alphabetic glyph*/
parse arg n cols . /*obtain optional argument from the CL.*/
if n=='' | n=="," then n = 501 /*Not specified? Then use the default.*/
Line 2,136:
say
say 'Found ' found title
exit 0 /*stick a fork in it, we're all done. */</langsyntaxhighlight>
{{out|output|text=&nbsp; when using the default inputs:}}
<pre>
Line 2,178:
 
=={{header|Ring}}==
<langsyntaxhighlight lang=ring>
see "working..." + nl
baseList = ["a","b","c","d","e","f"]
Line 2,205:
 
see nl + "done..." + nl
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 2,243:
</pre>
=={{header|Ruby}}==
<langsyntaxhighlight lang=ruby>puts (0..500).select{|n| n.digits(16).any?{|d| d >= 10} }.join(" ")</langsyntaxhighlight>
{{out}}
<pre>
Line 2,251:
=={{header|Sidef}}==
{{trans|Ruby}}
<langsyntaxhighlight lang=ruby>(0..500).grep {|n| n.digits(16).any {|d| d >= 10} }.join(" ").say</langsyntaxhighlight>
{{out}}
<pre>
Line 2,259:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<langsyntaxhighlight lang=ecmascript>import "/fmt" for Conv, Fmt
 
var nondecimal = "abcdef"
Line 2,271:
}
}
System.print("\n\n%(c) such numbers found.")</langsyntaxhighlight>
 
{{out}}
Line 2,302:
=={{header|XPL0}}==
Borrowed masking concept from C++, which was much more elegant than my first solution.
<langsyntaxhighlight lang=XPL0>func HasHex(N);
int N;
[while N do
Line 2,321:
CrLf(0);
IntOut(0, Cnt); Text(0, " such numbers found."); CrLf(0);
]</langsyntaxhighlight>
 
{{out}}
Line 2,346:
 
=={{header|Yabasic}}==
<langsyntaxhighlight lang=yabasic>sub needs_af (n)
while n > 0
if mod(n, 16) > 9 then return true : fi
Line 2,357:
if needs_af(i) then print i, " ", : fi
next i
end</langsyntaxhighlight>
10,333

edits