langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
18
Task/Boolean-values/NetRexx/boolean-values.netrexx
Normal file
18
Task/Boolean-values/NetRexx/boolean-values.netrexx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols nobinary
|
||||
|
||||
bval = [1, 0, 5, 'a', 1 == 1, 1 \= 1, isTrue, isFalse]
|
||||
|
||||
loop b_ = 0 for bval.length
|
||||
select case bval[b_]
|
||||
when isTrue then say bval[b_] 'is true'
|
||||
when isFalse then say bval[b_] 'is false'
|
||||
otherwise say bval[b_] 'is not boolean'
|
||||
end
|
||||
end b_
|
||||
|
||||
method isTrue public static returns boolean
|
||||
return (1 == 1)
|
||||
|
||||
method isFalse public static returns boolean
|
||||
return \isTrue
|
||||
1
Task/Boolean-values/OCaml/boolean-values.ocaml
Normal file
1
Task/Boolean-values/OCaml/boolean-values.ocaml
Normal file
|
|
@ -0,0 +1 @@
|
|||
type bool = false | true
|
||||
1
Task/Boolean-values/PL-I/boolean-values.pli
Normal file
1
Task/Boolean-values/PL-I/boolean-values.pli
Normal file
|
|
@ -0,0 +1 @@
|
|||
true is '1'b and false is '0'b
|
||||
3
Task/Boolean-values/Pascal/boolean-values-1.pascal
Normal file
3
Task/Boolean-values/Pascal/boolean-values-1.pascal
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
var
|
||||
pInt : ^integer ;
|
||||
ValidP : boolean ;
|
||||
1
Task/Boolean-values/Pascal/boolean-values-2.pascal
Normal file
1
Task/Boolean-values/Pascal/boolean-values-2.pascal
Normal file
|
|
@ -0,0 +1 @@
|
|||
if pInt then ...
|
||||
1
Task/Boolean-values/Pascal/boolean-values-3.pascal
Normal file
1
Task/Boolean-values/Pascal/boolean-values-3.pascal
Normal file
|
|
@ -0,0 +1 @@
|
|||
if pInt^ then ...
|
||||
1
Task/Boolean-values/Pascal/boolean-values-4.pascal
Normal file
1
Task/Boolean-values/Pascal/boolean-values-4.pascal
Normal file
|
|
@ -0,0 +1 @@
|
|||
if not(pInt = nil) then ValidP := true ;
|
||||
1
Task/Boolean-values/Pascal/boolean-values-5.pascal
Normal file
1
Task/Boolean-values/Pascal/boolean-values-5.pascal
Normal file
|
|
@ -0,0 +1 @@
|
|||
if ( ValidP ) and (pInt^ <> 0) then ...
|
||||
2
Task/Boolean-values/Perl-6/boolean-values.pl6
Normal file
2
Task/Boolean-values/Perl-6/boolean-values.pl6
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
my Bool $crashed = False;
|
||||
my $val = 0 but True;
|
||||
13
Task/Boolean-values/Pike/boolean-values.pike
Normal file
13
Task/Boolean-values/Pike/boolean-values.pike
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
> 0;
|
||||
(3) Result: 0
|
||||
> false;
|
||||
(4) Result: 0
|
||||
> 0;
|
||||
(6) Result: 0
|
||||
> !true;
|
||||
(7) Result: 0
|
||||
> true;
|
||||
(8) Result: 1
|
||||
> 1;
|
||||
(9) Result: 1
|
||||
>
|
||||
2
Task/Boolean-values/PostScript/boolean-values.ps
Normal file
2
Task/Boolean-values/PostScript/boolean-values.ps
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
true
|
||||
false
|
||||
5
Task/Boolean-values/PowerBASIC/boolean-values.powerbasic
Normal file
5
Task/Boolean-values/PowerBASIC/boolean-values.powerbasic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
DIM x AS LONG
|
||||
x = ISTRUE(1 = 1) ' returns -1
|
||||
x = ISTRUE(1 = 0) ' returns 0
|
||||
x = ISFALSE(1 = 1) ' returns 0
|
||||
x = ISFALSE(1 = 0) ' returns -1
|
||||
2
Task/Boolean-values/PowerShell/boolean-values.psh
Normal file
2
Task/Boolean-values/PowerShell/boolean-values.psh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$true
|
||||
$false
|
||||
6
Task/Boolean-values/Run-BASIC/boolean-values.run
Normal file
6
Task/Boolean-values/Run-BASIC/boolean-values.run
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
if 1 then print "1 is true"
|
||||
if not(0) then print "0 is false"
|
||||
if 1 < 2 then print "1 < 2 TRUE"
|
||||
if 2 > 1 then print "2 > 1 TRUE"
|
||||
if not(2 < 1) then print "2 not < 1"
|
||||
if not(1 = 0) then print "1 not = 0"
|
||||
1
Task/Boolean-values/Standard-ML/boolean-values.ml
Normal file
1
Task/Boolean-values/Standard-ML/boolean-values.ml
Normal file
|
|
@ -0,0 +1 @@
|
|||
datatype bool = false | true
|
||||
8
Task/Boolean-values/UNIX-Shell/boolean-values-1.sh
Normal file
8
Task/Boolean-values/UNIX-Shell/boolean-values-1.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
if
|
||||
echo 'Looking for file' # This is the evaluation block
|
||||
test -e foobar.fil # The exit code from this statement determines whether the branch runs
|
||||
then
|
||||
echo 'The file exists' # This is the optional branch
|
||||
echo 'I am going to delete it'
|
||||
rm foobar.fil
|
||||
fi
|
||||
1
Task/Boolean-values/UNIX-Shell/boolean-values-2.sh
Normal file
1
Task/Boolean-values/UNIX-Shell/boolean-values-2.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
true && echo "true" || echo "false"
|
||||
3
Task/Boolean-values/Visual-Basic/boolean-values.vb
Normal file
3
Task/Boolean-values/Visual-Basic/boolean-values.vb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Dim x As Boolean
|
||||
x = IIf(Int(Rnd * 2), True, False)
|
||||
MsgBox x
|
||||
9
Task/Boolean-values/XSLT/boolean-values.xslt
Normal file
9
Task/Boolean-values/XSLT/boolean-values.xslt
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<xsl:if test="true() or false()">
|
||||
True and false are returned by built-in XPath functions.
|
||||
</xsl:if>
|
||||
<xsl:if test="@myAttribute='true'">
|
||||
Node attributes set to "true" or "false" are just strings. Use string comparison to convert them to booleans.
|
||||
</xsl:if>
|
||||
<xsl:if test="@myAttribute or not($nodeSet)">
|
||||
Test an attribute for its presence (empty or not), or whether a node set is empty.
|
||||
</xsl:if>
|
||||
Loading…
Add table
Add a link
Reference in a new issue