It looks like you're new here. If you want to get involved, click one of these buttons!
-- Use this function to perform your initial setup
function setup()
clearLocalData()
alphabet = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}
iparameter("choose_a_letter_by_its_number",1,26,5)
iparameter("how_many", 1, 20, 7)
iparameter("value_of_how_many", 1, 200)
surrogate_string = alphabet[choose_a_letter_by_its_number]..how_many
print("new variable! "..surrogate_string)
saveLocalData(surrogate_string, value_of_how_many)
surrogate_string2 = readLocalData(surrogate_string)
print("with its own new value! "..surrogate_string2)
print("together now "..surrogate_string.." = "..surrogate_string2)
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- This sets the line thickness
strokeWidth(5)
end
function touched(touch)
clearParameters()
iparameter("choose_a_letter_by_its_number",1,26,choose_a_letter_by_its_number)
iparameter("how_many", 1, 20, how_many)
iparameter("value_of_how_many", 1, 200)
surrogate_string = alphabet[choose_a_letter_by_its_number]..how_many
print("new variable! "..surrogate_string)
saveLocalData(surrogate_string, value_of_how_many)
surrogate_string2 = readLocalData(surrogate_string)
print("with its own new value! "..surrogate_string2)
print("together now "..surrogate_string.." = "..surrogate_string2)
end
Description = "Completely parameterized variables"
Author = "beu5mi"
saveProjectInfo("Description", Description)
saveProjectInfo("Author",Author)
print(Description.." by "..Author)
Comments
Here's a slightly nicer version of it that can alter a variable in use
but it had to be specially coded for it to work that way is there any other way I could have coded this?