diff --git a/STATUS.md b/STATUS.md index 355f460..12909af 100755 --- a/STATUS.md +++ b/STATUS.md @@ -54,6 +54,7 @@ This file is used to track the language used in the current implementations: - [x] Perl - [x] PHP - [ ] PogoScript +- [x] Pony - [x] Potigol - [ ] Processing - [x] Progress - OpenEdge diff --git a/pony/main.pony b/pony/main.pony new file mode 100644 index 0000000..85fa296 --- /dev/null +++ b/pony/main.pony @@ -0,0 +1,7 @@ +actor Main + new create(env: Env) => + let s = Wesley.safadeza(1, 6, 96) + let a = Wesley.angel(s) + let message = Wesley.formatMessage(s, a) + env.out.print(message) + diff --git a/pony/pony b/pony/pony new file mode 100755 index 0000000..d8f7993 Binary files /dev/null and b/pony/pony differ diff --git a/pony/wesley.pony b/pony/wesley.pony new file mode 100644 index 0000000..fb438e0 --- /dev/null +++ b/pony/wesley.pony @@ -0,0 +1,26 @@ +primitive BasicMath + fun sum(x: F32): F32 => + var count: F32 = 1 + var sumValue: F32 = 0 + + while count <= x do + sumValue = sumValue + count + count = count + 1 + end + + sumValue + +primitive Wesley + fun safadeza(day: F32, month: F32, year: F32): F32 => + let m = BasicMath.sum(month) + let y = year / 100 + let d = 50 - day + + m + (y * d) + + fun angel(safadezaPercent: F32): F32 => + 100 - safadezaPercent + + fun formatMessage(safadaoPercent: F32, angelPercent: F32): String => + "Você é " + safadaoPercent.string() + "% safado e " + angelPercent.string() + "% anjo" +