Implementazioni di algoritmi/Calcolo della Pasqua: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Aggiunto Codice Visual basic per il calcolo del giorno di Pasqua
Riga 834:
 
{{Avanzamento|100%|9 aprile 2009}}
 
==[[Visual Basic]]==
Private Function CalcolaPasqua(Anno As Integer) As Date
Dim a As Double
Dim b As Double
Dim c As Double
Dim d As Double
Dim e As Double
Dim m As Double
Dim n As Double
Dim giorno As Double
Dim mese As Double
Dim pasqua As Date
If (Anno <= 2099) Then
m = 24
n = 5
ElseIf (Anno <= 2199) Then
m = 24
n = 6
ElseIf (Anno <= 2299) Then
m = 25
n = 0
ElseIf (Anno <= 2399) Then
m = 26
n = 1
ElseIf (Anno <= 2499) Then
m = 25
n = 1
End If
a = Anno Mod 19
b = Anno Mod 4
c = Anno Mod 7
d = ((19 * a) + m) Mod 30
e = ((2 * b) + (4 * c) + (6 * d) + n) Mod 7
If ((d + e) < 10) Then
giorno = d + e + 22
mese = 3
Else
giorno = d + e - 9
mese = 4
End If
If (giorno = 26 And mese = 4) Then
giorno = 19
mese = 4
End If
If (giorno = 25 And mese = 4 And d = 28 And e = 6 And a > 10) Then
giorno = 18
mese = 4
End If
CalcolaPasqua = Format(giorno & "/" & mese & "/" & Anno, "DD/MM/YYYY")
End Function