Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Level/Planet Names
From Turing Complete
Views
Read
Edit
Edit source
View history
associated-pages
Page
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Header Nav|game=Turing Complete}} {{Infobox level | section = Assembly Challenges | type = Architechture | architechture = Leg | prerequisite1 = Stack | scored = No | highscore = 37 | highscore-gate = 2 | highscore-delay = 2 | highscore-tick = 33 | api-enum-id = capitalize | api-enum-number = 68 }} ''We had the intern type out planet names in human script. Unfortunately, he forgot to capitalize each name.'' ''The inputs in this level represent the characters in a list of planet names, encoded as ASCII (see the manual). Each name is separated by a space which has the numeric value 32. Replace the first letter in each word with it's uppercase counterpart.'' ''(The possible input characters are a to z lowercase, space, apostrophe and dash)'' All one has to do is read each character in and, if it follows a space, subtract 32 from its value in order to capitalize it, then output the result. One approach to solving the level is: # Load 32 into Register 0. # Label the beginning of the loop. # Read the input into Register 1 # If Register 0 = 32, subtract 32 from Register 1 # Output Register 1 # Copy Register 1 to Register 0 # Loop back to step 2. As we pre-loaded a 32 in Register 0, in which we keep track of the last character we processed, it will capitalize the first character as if it had followed a space. {{Footer Nav|game=Turing Complete|prevpage=Tower of Alloy|nextpage=Water World}}
Summary:
Please note that all contributions to Turing Complete are considered to be released under the Creative Commons Attribution-ShareAlike (see
TuringComplete:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Table of Contents
(
view source
)
Template:-
(
edit
)
Template:Footer Nav
(
edit
)
Template:Header Nav
(
edit
)
Template:Ifnotempty
(
edit
)
Template:Infobox level
(
edit
)
Template:Level
(
edit
)
Template:P1
(
edit
)
Template:Truthtable/styles.css
(
edit
)