Michele Riva
Senior Software Architect @NearForm
σκοπέω
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
program average
implicit none
real, dimension(:), allocatable :: points
integer :: number_of_points
real :: average_points, positive_average, negative_average
average_points = 0.0
positive_average = 0.0
negative_average = 0.0
write (*,*) "Input number of points to average:"
read (*,*) number_of_points
allocate (points(number_of_points))
write (*,*) "Enter the points to average:"
read (*,*) points
if (number_of_points > 0) average_points = sum(points) / number_of_points
if (count(points > 0.) > 0) positive_average = sum(points, points > 0.) / count(points > 0.)
if (count(points < 0.) > 0) negative_average = sum(points, points < 0.) / count(points < 0.)
write (*,'(a,g12.4)') 'Average = ', average_points
write (*,'(a,g12.4)') 'Average of positive points = ', positive_average
write (*,'(a,g12.4)') 'Average of negative points = ', negative_average
end program average
MicheleRivaCode
1958 circa
MicheleRivaCode
(defun qsort (L)
(cond
((null L) nil)
(t
(append
(qsort (list< (car L) (cdr L)))
(cons (car L) nil)
(qsort (list>= (car L) (cdr L)))))))
(defun list< (a b)
(cond
((or (null a) (null b)) nil)
((< a (car b)) (list< a (cdr b)))
(t (cons (car b) (list< a (cdr b))))))
(defun list>= (a b)
(cond
((or (null a) (null b)) nil)
((>= a (car b)) (list>= a (cdr b)))
(t (cons (car b) (list>= a (cdr b))))))
MicheleRivaCode
1958 circa
MicheleRivaCode
Edsger Dijkstra
1972
Niklaus Wirth
1984
Peter Naur
2005
MicheleRivaCode
procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
value n, m; array a; integer n, m, i, k; real y;
comment The absolute greatest element of the matrix a, of size n by m
is transferred to y, and the subscripts of this element to i and k;
begin integer p, q;
y := 0; i := k := 1;
for p:=1 step 1 until n do
for q:=1 step 1 until m do
if abs(a[p, q]) > y then
begin y := abs(a[p, q]);
i := p; k := q
end
end Absmax
MicheleRivaCode
MicheleRivaCode
L←(Lι':')↓L←,L ⍝ drop To:
L←LJUST VTOM',',L ⍝ mat with one entry per row
S←¯1++/∧\L≠'(' ⍝ length of address
X←0⌈⌈/S
L←S⌽(−(⍴L)+0,X)↑L ⍝ align the (names)
A←((1↑⍴L),X)↑L ⍝ address
N←0 1↓DLTB(0,X)↓L ⍝ names)
N←,'⍺',N
N[(N='_')/ι⍴N]←' ' ⍝ change _ to blank
N←0 ¯1↓RJUST VTOM N ⍝ names
S←+/∧\' '≠⌽N ⍝ length of last word in name
1962
MicheleRivaCode
Begin
Procedure RightText(T, N, FitsIn); Text T; Integer N;
Name FitsIn; Boolean FitsIn;
Begin
Integer I;
FitsIn := N >= T.Length;
For i:=1 step 1 until N-T.Length do OutText(" ");
OutText(T)
End of RightText;
RightText("Short", 30); OutImage;
RightText("And the long one", 30);
End of Program;
1962
MicheleRivaCode
Max(Items, ValueFunction) = value of
§ (Best, BestVal) = (NIL, -∞)
while Items do §
(Item, Val) = (Head(Items), ValueFunction(Head(Items)))
if Val > BestVal then (Best, BestVal) := (Item, Val)
Items := Rest(Items) §⃒
result is Best §⃒
1963
MicheleRivaCode
05 HOME : TEXT : REM Fibonacci numbers
10 LET MAX = 5000
20 LET X = 1 : LET Y = 1
30 IF (X > MAX) GOTO 100
40 PRINT X
50 X = X + Y
60 IF (Y > MAX) GOTO 100
70 PRINT Y
80 Y = X + Y
90 GOTO 30
100 END
1964
MicheleRivaCode
main() {
extrn putchar, n, v;
auto i, c, col, a;
i = col = 0;
while(i<n)
v[i++] = 1;
while(col<2*n) {
a = n+1;
c = i = 0;
while (i<n) {
c =+ v[i] *10;
v[i++] = c%a;
c =/ a--;
}
putchar(c+'0');
if(!(++col%5))
putchar(col%50?' ': '*n');
}
putchar('*n*n');
}
v[2000];
n 2000;
1969
MicheleRivaCode
MicheleRivaCode
1972
MicheleRivaCode
C
1972
C++
1985
Java
1995
C#
2000
MicheleRivaCode
Scheme
1975
Caml
1985
Racket
1995
Clojure
2007
ML
1973
MicheleRivaCode
Pascal
1985
Simula
1962
Delphi
1995
MicheleRivaCode
MicheleRivaCode
Ole-Johan Dahl
Kristen Nygaard
MicheleRivaCode
Niklaus Wirth
MicheleRivaCode
Guido Van Rossum
MicheleRivaCode
Yukihiro Matsumoto
MicheleRivaCode
José Valim
MicheleRivaCode
MicheleRivaCode
8.900+ known programming languages
~2.500 🇺🇸
MicheleRivaCode
8.900+ known programming languages
~2.500 🇺🇸
~600 🇬🇧
MicheleRivaCode
8.900+ known programming languages
~2.500 🇺🇸
~600 🇬🇧
~160 🇨🇦
MicheleRivaCode
8.900+ known programming languages
~2.500 🇺🇸
~600 🇬🇧
~160 🇨🇦
~75 🇦🇺
MicheleRivaCode
MicheleRivaCode
'Hello, world'
MicheleRivaCode
(~R∊R∘.×R)/R←1↓ιR
MicheleRivaCode
2_&{&/x!/:2_!x}'!R
MicheleRivaCode
quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)
MicheleRivaCode
λf.(λx.(f(xx))λx.(f(xx)))
MicheleRivaCode
partition([], _, [], []).
partition([X|Xs], Pivot, Smalls, Bigs) :-
( X @< Pivot ->
Smalls = [X|Rest],
partition(Xs, Pivot, Rest, Bigs)
; Bigs = [X|Rest],
partition(Xs, Pivot, Smalls, Rest)
).
quicksort([]) --> [].
quicksort([X|Xs]) -->
{ partition(Xs, X, Smaller, Bigger) },
quicksort(Smaller), [X], quicksort(Bigger).
MicheleRivaCode
MicheleRivaCode
+[-[<<[+[--->]-[<<<]]]>>>-]>-.---.>..>.<<<<-.<+.>>>>>.>.<<.<-.
MicheleRivaCode
AGb-A#A#+A+%A#DF-AC#
MicheleRivaCode
"" .H .e .l .l .o ., ._ .w .o .r .l .d .! ()
MicheleRivaCode
](104)](101)](108)](108)](111)](44)](32)](119)](111)](114)](108)](100)](10)
MicheleRivaCode
>>v
v1?2v
3
> > >: v
|-&<
$
>"!tcerroC">:v
|,<
@
MicheleRivaCode
MicheleRivaCode
https://codegolf.stackexchange.com/questions/244101/sort-numbers-in-a-ragged-list
input: [[4, 7], [5, 3, [], [6, [2]]]
output: [[÷2, 3], [4, 5, [], [6, [7]]]]
FṢṁ
Jelly
N`\d+
Retina
1N→_a`\d+`?λ←_a1+→_a`\d+`?Ẏ⌊s←_a iS;øṙ
Vyxal
n=>n.replace(r=/\d+/g,_=>n.match(r).sort((a,b)=>a-b)[i++],i=0)
JavaScript
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
Tab
Space
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
BonjourLeMonde:
début
affiche "Bonjour le monde!"
MicheleRivaCode
K) PROGRAM DRUKUJE NAPIS HELLO WORLD
LINIA
TEKST:
HELLO WORLD
KONIEC
System Automatycznego Kodowania Operacji
MicheleRivaCode
ПРОЦ СТАРТ()
ВЫВОД: 'Привет, мир!'
КОН ПРОЦ
MicheleRivaCode
「Hello, World!」と、表示。 ’母艦(メインフォーム)に表示。
「Hello, World!」と、言う。 ’ダイアログボックスで表示。
Himawari
MicheleRivaCode
(قول "مرحبا يا عالم")
Qalb
MicheleRivaCode
公开 类 启动类
{
公开 静态 启动()
{
控制台.输出("你好,世界!");
}
}
EPL (Easy Programming Language)
MicheleRivaCode
$ ./brambilla
🍎 ▶ (ciapa x 5)
🍎 ▶ (+ x 10)
15
🍎 ▶ (ciapa-che! x 10)
🍎 ▶ (= x 5)
#è minga vera
🍎 ▶ fèrmes
https://github.com/micheleriva/CadregaLisp
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
MicheleRivaCode
@MicheleRiva
@MicheleRivaCode
/in/MicheleRiva95
www.micheleriva.dev