• Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Elm
  • Created almost 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

👼Polyglot implementations of "safadeza" calculus.

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

The last two functions MUST return a float

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

Basic Requirements

  • You MUST be listening to the music while coding.
  • If you have to stop listening, close the editor - your time is over!
  • Please, don' use tabs. Tabs are from Satan. Use spaces. - actually, just follow the basic styleguide.

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 :)

If you'd like to contribute with a language in which the algorithm has already been implemented - but you have a new/special/different/whatever way of making -, you can make it! Just create a new folder inside the folder of the language, e.g. javascript/browser, javascript/node, javascript/react etc.

Adding a New Language

  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.

Importance

This project may seem useless, but, amazingly, it is not.

In about two days it achieved something interesting: a deterministic algorithm said to be simple which when implemented in 40+ languages, tells us a lot! E.g.

So the lesson is: that kind of initiative shows us that in modern times not only with FizzBuzz-alike implementations you can learn programming logic/languages/ paradigms.

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.

More Repositories

1

You-Dont-Know-X

🙈 curated list of inspiring resources which show you don't know that much about something you thought you knew.
151
star
2

happy-valentines

💖Simple module to show your love on this Valentine's Day.
LiveScript
52
star
3

flat-palettes

🎨Need color inspiration? No problem! Have some fantastic random color palettes.
LiveScript
44
star
4

hojetem.live

🎶 Curated live concerts from famous Brazilian artists.
TypeScript
44
star
5

react-native-web-monorepo-navigation

⚛️ An opinionated universal navigation strategy for codebases containing both React & React Native.
TypeScript
26
star
6

bepid-studies

📝Notes, exercises and content produced over a month of preparation for the Apple Developer Academy exam.
C
24
star
7

generator-ocaml

🐫Yeoman generator to scaffold OCaml modules.
JavaScript
22
star
8

space

✨ My website built with Next.js, TypeScript, and Tailwind.
TypeScript
18
star
9

react-matchez

🤓 Declarative, typed, pattern matching library for React, with smart type inference.
TypeScript
14
star
10

brazilian-boundaries

🗺️ Municipal boundaries of all Brazilian cities.
JavaScript
11
star
11

codeicons

📦 An icon set of programming languages, frameworks, and coding tools.
CSS
10
star
12

appstore-sku-editor

A CLI tool that provides some App Store connect utilities
TypeScript
9
star
13

vapor-x-hub-middleware

🔑 X-Hub-Signature Vapor middleware.
Swift
8
star
14

resistance.js

⚡Simple module to calculate electrical resistance in series and parallel circuits.
LiveScript
8
star
15

gamepads

React hook for providing info from gamepads connected to the system
JavaScript
7
star
16

clipboard

React hook for providing both read and write access to the system clipboard.
JavaScript
7
star
17

trabalho-poo

Trabalho POO - AV2
Java
6
star
18

piglatin-translator

A web app that translates English text input into Pig Latin.
TypeScript
6
star
19

GammaFn

🔢 Gamma function (Γ) from mathematics in Swift.
Swift
3
star
20

talks

📢 💻 Slides - and more stuff - from my presentations.
HTML
3
star
21

eventio

A web app that allows registered users to sign up for and create events.
TypeScript
3
star
22

lumberpack

Easily create projects with a bunch of cool technologies.
JavaScript
3
star
23

getcodeicons

Repo for the official Code Icons site.
JavaScript
3
star
24

python-homework

Some (as easy as possible) exercises from my programming logic discipline, implemented using Python.
Python
2
star
25

brazilian-horror-story

💬 Some quotes from federal legislators during the vote on impeachment.
LiveScript
2
star
26

techlabs-workshop-weekend-2020

Sample app used during my "Building a modern front-end application for your project" workshop.
TypeScript
2
star
27

resume

My resume in a few formats (Markdown, PDF etc.).
TeX
1
star
28

getmilla

Repo for the official Milla theme's site.
CSS
1
star
29

js4girls-fortaleza

👧 👩 👵 Repo to organize JS4Girls in Fortaleza
1
star
30

slides-flisol-2015

Slides from my talk at Festival Latino Americano de Instalação de Software Livre (FLISOL 2015) about the importance of versioning and sharing code on Github.
HTML
1
star
31

cs-exercises

Exercices from the most variate courses I take at my BsC in CS.
JavaScript
1
star
32

gatsby-starter-netlify-cms

JavaScript
1
star
33

xzibit

Create presentations using cool kids' technologies.
JavaScript
1
star
34

dracula-hyperterm

😱 A dark theme for HyperTerm
JavaScript
1
star
35

wsa-server-mock

1
star
36

deeply-checked-effect

React hook for providing an alternative for useEffect that does a deep comparison of passed objects
JavaScript
1
star
37

merry-christmas

Just a simple image-free Christmas tree to say "Merry Christmas!"
JavaScript
1
star
38

front-end-ce-talk-demo-server

1
star
39

pacman

Pacman game made in C.
C
1
star