June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
26
Task/Variables/Falcon/variables.falcon
Normal file
26
Task/Variables/Falcon/variables.falcon
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* partially created by Aykayayciti Earl Lamont Montgomery
|
||||
April 9th, 2018 */
|
||||
|
||||
/* global and local scrope
|
||||
from the Falcon survival
|
||||
guide book */
|
||||
// global scope
|
||||
sqr = 1.41
|
||||
|
||||
function square( x )
|
||||
// local scope
|
||||
sqr = x * x
|
||||
return sqr
|
||||
end
|
||||
|
||||
|
||||
number = square( 8 ) * sqr
|
||||
|
||||
|
||||
a = [1, 2, 3] // array
|
||||
b = 1 // variable declaration
|
||||
e = 1.0 // float
|
||||
f = "string" // string
|
||||
|
||||
/* There are plenty more
|
||||
data types in Falcon */
|
||||
33
Task/Variables/HicEst/variables.hicest
Normal file
33
Task/Variables/HicEst/variables.hicest
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
! Strings and arrays must be declared.
|
||||
! Everything else is 8-byte float, READ/WRITE converts
|
||||
CHARACTER str="abcdef", str2*345, str3*1E6/"xyz"/
|
||||
REAL, PARAMETER :: named_constant = 3.1415
|
||||
REAL :: n=2, cols=4, vec(cols), mtx(n, cols)
|
||||
DATA vec/2,3,4,5/, mtx/1,2,3.1415,4, 5,6,7,8/
|
||||
|
||||
named = ALIAS(alpha, beta, gamma) ! gamma == named(3)
|
||||
ALIAS(vec,n, subvec,2) ! share subvec and vec(n...n+1)
|
||||
ALIAS(str,3, substr,n) ! share substr and str(3:3+n-1)
|
||||
|
||||
a = EXP(b + c) ! assign/initialze a=1, b=0, c=0
|
||||
str = "blahblah" ! truncate/expand if needed
|
||||
beta = "blahblah" ! illegal
|
||||
|
||||
CALL noArguments_noUSE ! global scope SUBROUTINE
|
||||
CALL Arguments_or_USE(a) ! local scope SUBROUTINE
|
||||
t = func() ! local scope FUNCTION
|
||||
|
||||
SUBROUTINE noArguments_noUSE() ! all global
|
||||
vec2 = $ ! 1,2,3,...
|
||||
END
|
||||
|
||||
SUBROUTINE Arguments_or_USE(var) ! all local
|
||||
USE : vec ! use global object
|
||||
var = SUM(vec)
|
||||
t = TIME() ! local, static, USEd by func()
|
||||
END
|
||||
|
||||
FUNCTION func() ! all local
|
||||
USE Arguments_or_USE : t ! use local object
|
||||
func = t
|
||||
END
|
||||
1
Task/Variables/HolyC/variables-1.holyc
Normal file
1
Task/Variables/HolyC/variables-1.holyc
Normal file
|
|
@ -0,0 +1 @@
|
|||
U8 i;
|
||||
2
Task/Variables/HolyC/variables-2.holyc
Normal file
2
Task/Variables/HolyC/variables-2.holyc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
U8 b1 = 8;
|
||||
U8 b2 = b1 * 10;
|
||||
1
Task/Variables/HolyC/variables-3.holyc
Normal file
1
Task/Variables/HolyC/variables-3.holyc
Normal file
|
|
@ -0,0 +1 @@
|
|||
U8 uint1, uint2, uint3;
|
||||
1
Task/Variables/HolyC/variables-4.holyc
Normal file
1
Task/Variables/HolyC/variables-4.holyc
Normal file
|
|
@ -0,0 +1 @@
|
|||
U8 *str = "The HolyC Language";
|
||||
13
Task/Variables/HolyC/variables-5.holyc
Normal file
13
Task/Variables/HolyC/variables-5.holyc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
global gvar # a global
|
||||
|
||||
procedure main(arglist) # arglist is a parameter of main
|
||||
local a,b,i,x # a, b, i, x are locals withing main
|
||||
static y # a static (silly in main)
|
||||
|
||||
x := arglist[1]
|
||||
a := 1.0
|
||||
i := 10
|
||||
b := [x,a,i,b]
|
||||
|
||||
# ... rest of program
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
say ++$; # this is an anonymous state variable
|
||||
say ++$; # this is a different anonymous state variable, prefix:<++> forces it into numerical context and defaults it to 0
|
||||
say $+=2 for 1..10 # here we do something useful with another anonymous variable
|
||||
say $+=2 for 1..10; # here we do something useful with another anonymous variable
|
||||
|
||||
sub foo { $^a * $^b } # for positional arguments we often can't be bothered to declare them or to give them fancy names
|
||||
say foo 3, 4;
|
||||
|
|
|
|||
8
Task/Variables/Python/variables.py
Normal file
8
Task/Variables/Python/variables.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# these examples, respectively, refer to integer, float, boolean, and string objects
|
||||
example1 = 3
|
||||
example2 = 3.0
|
||||
example3 = True
|
||||
example4 = "hello"
|
||||
|
||||
# example1 now refers to a string object.
|
||||
example1 = "goodbye"
|
||||
|
|
@ -4,7 +4,7 @@ cc = 2*10 /*assigns chars 20 ───► CC
|
|||
dd = 'Adam' /*assigns chars Adam ───► DD */
|
||||
ee = "Adam" /*same as above ───► EE */
|
||||
ff = 10. /*assigns chars 10. ───► FF */
|
||||
gg='10.' /*same as above ───► GG */
|
||||
gg = '10.' /*same as above ───► GG */
|
||||
hh = "+10" /*assigns chars +10 ───► hh */
|
||||
ii = 1e1 /*assigns chars 1e1 ───► ii */
|
||||
jj = +.1e+2 /*assigns chars .1e+2 ───► jj */
|
||||
|
|
|
|||
4
Task/Variables/Visual-Basic-.NET/variables.visual
Normal file
4
Task/Variables/Visual-Basic-.NET/variables.visual
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Dim wholeNumber as Integer = 3
|
||||
Dim realNumber as Double = 3.0
|
||||
Dim isRaining as Boolean = False
|
||||
Dim greeting as String = "Hello, this is World speaking."
|
||||
Loading…
Add table
Add a link
Reference in a new issue