Algorithm

Lottery as a Smart Contract: The Execution

Lottery as a Smart Contract: The Execution

This is part 2 of the “Lottery as a Smart Contract” series. In part 1, I described the business logic behind the Lottery Smart Contract. Here, I will demonstrate how this contract is executed. To run this, you will need: Remix, the Solidity IDE here. Metamask wallet with 2 accounts that have some ETH in

Lottery as a Smart Contract: The Business Logic

Lottery as a Smart Contract: The Business Logic

Writing a lottery contract is a great way to learn important Smart Contract concepts such as State, Event and Visibility. In this 3 part series, I will describe the logic and codes behind a Lottery Smart Contract. In developing my Lottery Contract, I used Oraclize, a data carrier service that executes external JSON web services. Motivation

Codility before lunch

Codility before lunch

Like how new recruits in the army are required to do a few pull-ups before lunch, I make myself complete at least 2 Codility challenges a week. If nothing, it helps to keep the mind thinking algorithmically – which I believe is a good thing. This challenge requires one to cycle through a series of

More Codility

More Codility

The 2nd Codility lesson is to search for the odd number of elements in an array that cannot be paired with any other element. Codility provided this example. A[0] = 9, A[1] = 3, A[2] = 9 A[3] = 3, A[4] = 9, A[5] = 7 A[6] = 9 Apart from A[5], every other element has

Learning on Codility

Learning on Codility

Codility is where programmers receive programming tests as interview questions. This is also where programmers could learn to code. I am at lesson 1 on Iterations, and here’s my answer. It finds the binary gap of a number. A binary gap is the longest sequence of 0 of a number converted to binary. For example,