IanRamosC / safadometro

Polyglot implementations of "safadeza" calculus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

safadômetro

Polyglot implementations of "safadeza" calculus.

Aquele 1%

Table of Contents

The Problem

Sometimes, you want to know how safad(o/a) - a Brazilian Portuguese word for naughty - someone is. A very popular Brazilian musician desbribes himself as being 99% an angelical and perfect person; but the other 1% is naughty - as you can see in the lyrics.

A very clever professor from a state university in Brazil proposed a way o calculing how safado some is based on his/her date of birth.

The magical formula needs:

  • A sum function which takes an int a returns the sum of it with all its previous positive integers, e.g. sum(5) = 5 + 4 + 3 + 2 + 1.

  • A safadeza function which is given by:

    safadeza = sum(month) + (year / 100) * (50 - day)

  • An angel function which is given by:

    angel = 100 - safadeza

So this repo is for writing code that shows others how safado they are.

I look forward to seeing what you come up with c:

Motivation

Where everything started.

The programming question which quotes Wesley Safadão and turned to be a hit on the web.

It all started when a professor from the Quixadá campus of the Federal University of Ceará - Universidade Federal do Ceará (UFC) - Jefferson de Carvalho called everyone's attention by using a hit of the sertanejo and forró music to teach imperative programming logic to his students.

He was inspired by the song Aquele 1%, which is a success from the duo Marcos & Belutti featuring a very popular Brazilian musician, Wesley Safadão, to write his logical challenge.

If you'd like to find out more content about this funny story, there are lots of good resources on the web about it.

Contributing

  1. You must be listening the music while coding.
  2. You MUST BE listening the music while coding.
  3. If you have to stop listening, close the editor your time is over!

Adding a New Implementation

  1. Just think of your own interpretation of the problem.
  2. Check if anyone has suggested this before here.
  3. Fork this project!
  4. Create a new folder with the name of the language you've used in your solution, e.g. javascript/.
  5. If the language you want to implement already has an implemention, make version-* in the folder!
  6. Put the implementation and the example in separated files.
  7. Tick the language - with - [x] in GitHub Flavored Markdown - in which you've implemented here.
  8. Commit your changes: git commit -m 'Add JavaScript version'.
  9. Push to the branch: git push origin master.
  10. Submit a pull request :)

Adding a New Language

Please, don' use tabs. Tabs are from Satan. Use spaces.

  1. Check if anyone has suggested this before here.
  2. Fork this project!
  3. Add the language to the languages tracking file - don't forget to obey alphabetical order.
  4. Commit your changes: git commit -m 'Add JavaScript to listed languages'.
  5. Push to the branch: git push origin master.
  6. Submit a pull request :)

Status

You can check a list of languages in which the problem's been implemented - or should've been - here.

License

safadômetro is distributed under the MIT License, available in this repository. All contributions are assumed to be also licensed under the MIT License.

Wesley Oliveira da Silva, also known as Wesley Safadão, is a Brazilian singer, songwriter, producer, and businessman. The safadômetro project does not have any rights over anything related to the him; images, logos, and everything related to the him have All Rights Reserved to Wesley Safadão & Banda Garota Safada.

About

Polyglot implementations of "safadeza" calculus.


Languages

Language:HTML 8.7%Language:OpenEdge ABL 7.2%Language:Java 7.2%Language:C# 5.7%Language:Haskell 5.4%Language:C 5.0%Language:COBOL 4.9%Language:Elixir 4.7%Language:Smalltalk 4.7%Language:Pascal 4.1%Language:JavaScript 4.0%Language:Visual Basic 3.8%Language:Elm 3.7%Language:CoffeeScript 3.0%Language:Go 2.9%Language:xBase 2.7%Language:Hy 2.6%Language:Shell 2.5%Language:Ruby 2.5%Language:Python 2.4%Language:Clojure 2.2%Language:Scala 2.2%Language:Dart 2.1%Language:C++ 2.0%Language:PHP 2.0%Language:LiveScript 1.7%