Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[gray]// set the reversed string to the original, but replace the groups of non-space characters with placeholders, for example $[/gray]
original := ' one two three four'
reversed := ' $ $ $ $'
currently_in_a_word := no [gray]// in original we are inside a group of non-space characters[/gray]
current_placeholder := 0 [gray]// in reversed this is the current place_holder position[/gray]
loop backward through original character by character
current_character := original's current character
if current_character is a space
if currently_in_a_word
currently_in_a_word := no
end if
else [gray]// not a space[/gray]
if not currently_in_a_word [gray]// first character of a non-space group[/gray]
currently_in_a_word := yes
advance current_placeholder to the next one
remove the placeholder character at current_placeholder
end if
insert current_character in reversed at current_placeholder
end if
end loop