Implementazioni di algoritmi/Calcolo della Pasqua: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica |
m Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Riga 3:
==[[w:Basic|Basic]]==
<
10 'PASQUA.BAS
20 'Calcolo data della pasqua calendario gregoriano
Riga 21:
200 Z$ = INKEY$: IF Z$ = "" THEN 200 ELSE ZZ$ = MID$(Z$, 2, 1): S% = ASC(Z$)
210 IF S% = 27 THEN SYSTEM ELSE 60
</syntaxhighlight>
==[[JavaScript]]==
<
var a;
var b;
Riga 89:
mese=4;
}
</syntaxhighlight>
==[[w:Matlab|Matlab]]==
<
function [day,month]=Easter(Y)
Riga 155:
month=4;
end
</syntaxhighlight>
==[[C]]==
<
#include <stdio.h>
Riga 247:
}
</syntaxhighlight>
==[[Java]]==
<
import java.util.Calendar;
import java.util.Date;
Riga 322:
}
}
</syntaxhighlight>
==[[Prolog]]==
Questa versione è reversibile, cioè permette indifferentemente di calcolare il giorno della Pasqua dato l'anno, oppure gli anni in cui la Pasqua è caduta in un certo giorno.
<
pasqua(Anno,Mese,Giorno):-
numero(Anno,1600,2599),
Riga 366:
mn(23,26,1).
mn(24,25,1).
</syntaxhighlight>
==[[w:Delphi|Delphi]]==
<
unit UPasqua;
Riga 429:
end.
</syntaxhighlight>
==[[w:TSQL|TSQL]]==
<
CREATE FUNCTION [dbo].[CalcolaPasqua]
(
Riga 492:
return @pasqua
END
</syntaxhighlight>
==[[w:SQL|SQL]]==
<
declare a decimal;
declare b decimal;
Riga 542:
set mese=4;
end if;
</syntaxhighlight>
==[[PHP]]==
<
function DataPasqua ($Y) {
Riga 628:
}
</syntaxhighlight>
==[[Python]]==
<
def pasqua(anno):
if anno<1583 or anno>2499: return None
Riga 652:
giorno-=7
return giorno, mese, anno
</syntaxhighlight>
==PL/SQL==
<
DECLARE
a DECIMAL;
Riga 718:
DBMS_OUTPUT.put_line( 'Pasqua -> ' || TO_CHAR( pasqua, 'dd/mm/rrrr' ) );
END;
</syntaxhighlight>
==BASH==
<
#!/bin/bash
Riga 801:
fi
echo $data
</syntaxhighlight>
==Perl==
<
#!/usr/bin/perl
use integer;
Riga 827:
exit(0);
</syntaxhighlight>
==[[w:Visual Basic|Visual Basic]]==
<
Private Function CalcolaPasqua(Anno As Integer) As Date
Dim a As Double
Riga 890:
CalcolaPasqua = dateserial(Anno, mese, giorno)
Cioè il valore di ritorno è il nome della funzione stessa.
</syntaxhighlight>
== COBOL ==
Riga 996:
== C# ==
<
public class EasterCalculation
{
Riga 1 040:
}
}
</syntaxhighlight>
== Altri progetti ==
|