Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
define function main_program() {
    set tmp_array to [69, 32, 116, 110, 101, 108, 108, 101, 99, 120, 69];
    // with tmp_array[1] = 69, tmp_array[2] = 32, etc.

    set counter to the number of entries in tmp_array; 
    run foo(tmp_array, counter);
}

define function foo(a_data_array, a_counter) {
    if (a_counter is equal to or more than 1) then {
        display the character for ASCII code value a_data_array[a_counter];
        do foo(a_data_array, a_counter - 1);
    }
    else if (a_counter is equal or less than 0) then
    {
        display "45A!";
        stop the program;
    }
}

run main_program()


What I have tried:

Covert it to javascript, but that is not what is being asked
Posted
Updated 1-Nov-20 14:31pm
v3
Comments
Richard Deeming 2-Nov-20 10:03am    
Changing the content of your question after it has been answered is extremely rude.

It will also not prevent your teacher from noticing your attempt to cheat on your homework.

Always assume your teacher is aware of sites like CodeProject, and is watching everything you post here.

You are expected to go through each line of the pseudocode and work out what it is doing. This is an exercise in understanding logic, and most people here already have a reasonable grasp of the subject. So give it a try (one line at a time), it is not as difficult as it looks. Use paper and pen to note down intermediate results as you work through it.
 
Share this answer
 
It's pretty simple stuff, but this may help you: ASCII Table[^] - you want the decimal column.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900