Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,3 +1,6 @@
for(i=1; i <= length(strs); i++) {
print strs[i]
BEGIN {
n = split("Mary had a little lamb", strs, " ")
for(i=1; i <= n; i++) {
print strs[i]
}
}

View file

@ -1,2 +1,2 @@
std::copy(container.begin(), container.end(),
std::output_iterator<container_type::value_type>(std::cout, "\n"));
std::ostream_iterator<container_type::value_type>(std::cout, "\n"));

View file

@ -1,5 +1,3 @@
#include <iterator_concepts>
for (auto element: container)
{
std::cout << element << "\n";

View file

@ -1,5 +1,3 @@
#include <iterator_concepts>
for (auto const& element: container)
{
std::cout << element << "\n";

View file

@ -0,0 +1,4 @@
for (auto&& element: container) //use a 'universal reference'
{
element += 42;
}

View file

@ -0,0 +1,3 @@
<Cfloop list="Fee, Fi, Foe, Fum" index="i">
<Cfoutput>#i#!</Cfoutput>
</Cfloop>

View file

@ -0,0 +1,2 @@
(dolist (x '(1 2 3 4))
(message "x=%d" x))

View file

@ -0,0 +1,3 @@
(mapc (lambda (x)
(message "x=%d" x))
'(1 2 3 4))

View file

@ -0,0 +1,24 @@
include std/console.e
sequence s = {-2,-1,0,1,2} --print elements of a numerical list
for i = 1 to length(s) do
? s[i]
end for
puts(1,'\n')
s = {"Name","Date","Field1","Field2"} -- print elements of a list of 'strings'
for i = 1 to length(s) do
printf(1,"%s\n",{s[i]})
end for
puts(1,'\n')
for i = 1 to length(s) do -- print subelements of elements of a list of 'strings'
for j = 1 to length(s[i]) do
printf(1,"%s\n",s[i][j])
end for
puts(1,'\n')
end for
if getc(0) then end if

View file

@ -1,4 +1,5 @@
for i in collect do
(
print i
)
arr = for i in 1 to 50 collect ("Number: " + (random 10 99) as string)
makeuniquearray arr
sort arr
for i in arr do print i as string

View file

@ -0,0 +1 @@
(map println '(Apple Banana Coconut))

View file

@ -0,0 +1,7 @@
?- foreach(member(X, [red,green,blue,black,white]), writeln(X)).
red
green
blue
black
white
true.

View file

@ -5,6 +5,6 @@ for eachline in f:
for eachword in eachline.split():
words += 1
for eachchar in eachword:
chracters += 1
characters += 1
print lines, words, characters

View file

@ -0,0 +1,7 @@
d = {3: "Earth", 1: "Mercury", 4: "Mars", 2: "Venus"}
for k in sorted(d):
print("%i: %s" % (k, d[k]))
d = {"London": "United Kingdom", "Berlin": "Germany", "Rome": "Italy", "Paris": "France"}
for k in sorted(d):
print("%s: %s" % (k, d[k]))

View file

@ -0,0 +1,3 @@
d = {"fortytwo": 42, 3.14159: "pi", 23: "twentythree", "zero": 0, 13: "thirteen"}
for k in sorted(d):
print("%s: %s" % (k, d[k]))

View file

@ -2,4 +2,5 @@ days = 'zuntik montik dinstik mitvokh donershtik fraytik shabes'
do j=1 for words(days) /*loop through days of the week. */
say word(days,j) /*display the weekday to screen. */
end /*j*//*stick a fork in it, we're done.*/
end /*j*/
/*stick a fork in it, we're done.*/

View file

@ -0,0 +1,3 @@
for i in ["alpha", "beta", 42, 5.54]
echo i
endfor