JS Coding Task solution: Assigning weights to beneficiaries based on input.

in #utopian-io6 years ago (edited)

Repository

https://github.com/Ominousness/utopian-beneficiaries

New Project

This JavaScript library is a response to this coding task: https://steemit.com/utopian-io/@utopian.tasks/js-developers-and-regex-experts-wanted-javascript-coding-task

I've used node.js and ES6. This code should work in recent browsers sans the testing part, which I'm not sure will work (I haven't used jest [the testing suite] on the client-side yet.)

I'm using regular expressions for most of the parsing. Exact expressions with the explanation are available here: https://github.com/Ominousness/utopian-beneficiaries/blob/master/beneficiaries.js#L7

Most of the sanity checks happen in the Javascript part, though.

2018-05-24-170139_1089x356_scrot.png

Unit tests are also included to check for regressions that may happen on accident.

// Import the library.
const beneficiaries = require('./beneficiaries');

// Pass the message as the (only) argument.
beneficiaries('@utopian-bot !utopian @mention1:15% @mention2:35% @mention3:25% @mention4:25%');// Im

Roadmap

The project will serve its purpose once it's used in the bot code.

How to contribute?

Submit a new pull request: https://github.com/Ominousness/utopian-beneficiaries/pulls

GitHub Account

https://github.com/Ominousness

Sort:  

Thanks for the contribution!

Your contribution has been chosen as the solution to the task request, as we think it follows the instructions in the task request the best and has the highest quality code. It is great you included unit tests as well!

Thanks for participating!


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you very much, looking forward to seeing this implemented in the bot.

Hey @nepeta
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

You are really lucky. Your 1st post for utopian.io accept and upvote you . I think you worked heard . Enjoy your self. Gob bless you . I hope you will success

Hello. I saw your name was mentioned in a post that listed some experienced developers. I am putting together a project with Steemit user @tibra to create something very cool built on the Steem blockchain. Our platform will allow users to create ICOs/Dapps that are built on Steem - complete with their own unique tokens.

Our software will allow you to create "double consensus" tokens. Who holds which token is determined by Steem blockchain consensus. And the rate of inflation and token creation is determined by consensus of token holders.

Our team is growing. We're all working for a split in a fixed percentage of platform SBD/Steem reward as a beneficiary. The ultimate goal is to get a MVP/demo up and running ASAP and then get a little VC money to create something more robust.

From there, the idea is to allow the rapid creation of specialized sidechains. The plan is to "Steemify" already-successful businesses such as Tinder, Netflix, Scribd, etc. In addition to improving user experience, we'll also make these businesses convenient and trustless.

Sorry for the long comment, but the point is that we'd like to talk to you more to see if you'd like to get involved. If so, send me a message on Discord at yallapapi#1970 and I'll send you an invite to our channel.

Congratulations @nepeta! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!