# Algorithm Clifford Engine

CLOSED
Bids
11
Avg Bid (USD)
\$194
Project Budget (USD)
\$30 - \$250

Project Description:
Hi Freelancers

This job must be done within next 24-48 hours. Pls see the details below -

“You are asked to build, in a language of PHP, java. and with assurance that the code is working as expected, an implementation of The Clifford Engine.

Description of the Clifford Engine

The Clifford Engine does one job but it does it well: it looks after a stack of numbers.

You can interact with the Engine by giving it a list of numbers. This represents a program in Clifford Code, described below. The Engine will execute the code and output the number at the top of the stack when the program terminates.

Clifford code is made up of a list of whitespace-separated numbers that are processed in sequence. Each instruction is made up of one or more digits, depending on the type of instruction. The first digit always specifies the type of instruction.

As of January 2012 the Clifford Engine supports the following instructions:

0 "Push" (takes 1 argument)
Pushes its argument onto the Clifford stack.

1 "Pop" (takes no arguments)
Discards the number at the top of the Clifford stack.

Removes the top two numbers from the stack, adds them and then pushes the total back onto the stack.

3 "Subtract" (takes no arguments)
Removes the top two numbers from the stack, subtracts them and then pushes the total back onto the stack.

4 "Multiply" (takes no arguments)
Removes the top two numbers from the stack, multiplies them and then pushes the total back onto the stack.

5 "Divide" (takes no arguments)
Removes the top two numbers from the stack, divies them and then pushes the result back onto the stack.

Consider the following examples:
0 2 0 2 2 yields the result 4
0 5 0 3 3 yields the result 2
0 10 0 10 4 yields the result 100
0 10 0 5 5 yields the result 2
0 10 0 5 4 0 2 5 yields the result 25

Please write a simulation of the Clifford Engine. Your solution should be efficient and easy to extend. Dr. Clifford is interested in exploring conditional branching instructions later in the year.

You can pick any programming language - we are looking for a solution that is clear, idiomatic, and interesting.

How can you be sure that your Clifford Engine is working as expected?

If you execute the following Clifford Code, what is the result you get expressed in hex?
0 60 0 10 3 0 180 0 3 5 4 0 4 2

Thanks

Skills required:
Java, Javascript, PHP, Software Architecture, Website Design
Project ID: 4369013
Report Project
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

\$ 110
in 0 days
\$ 412
in 16 days
\$ 412
in 15 days
\$ 100
in 0 days
\$ 105
in 1 days
\$ 175
in 1 days
\$ 140
in 3 days
\$ 200
in 3 days
\$ 90
in 1 days
\$ 136
in 0 days