Discuss Scratch

Endermangames2
Scratcher
18 posts

How do I remove part of an answer

I'm trying to remove part of a answer to a question in order to set it as a variable that my current code can work with, but cant seem to figure out how.

More specifically, I'm trying to remove part of a command in order to just get the number
The command in question
//dash #

the # is a number
PlatoHero_
Scratcher
500+ posts

How do I remove part of an answer

Will the number have many digits?

Last edited by PlatoHero_ (Dec. 1, 2021 14:49:02)


Shift + down to see the rest
when gf clicked
repeat until <not <[List of Scratchers v] contains [non-CoR member]>
say (join [The Chair of Republic] (join [us,] [we have cookies!]))
end
If you want some cookies, click or press the rickrolls.
There are three bands called stones: Rolling stones, trolling stones and rickrolling stones.

List of Scratchers I like and have left:
-TheGreenNinja-
the2000
GoldenEagleStudios
Rae-TV is going to be the next.
Endermangames2
Scratcher
18 posts

How do I remove part of an answer

normally, no, but i wish to allow any number

but normally it wont be massive
PlatoHero_
Scratcher
500+ posts

How do I remove part of an answer

Endermangames2 wrote:

normally, no, but i wish to allow any number

but normally it wont be massive
Hmm, I have an idea.
define take the number
set [counter v] to (7)
repeat ((length of (answer)) - (7))
change [counter v] by [1]
set [dash number v] to (join (dash number) (letter (counter) of (answer))
After you run the command take the number, the dash number variable will be set to the number part. Hope this helped.

Last edited by PlatoHero_ (Dec. 1, 2021 21:28:24)


Shift + down to see the rest
when gf clicked
repeat until <not <[List of Scratchers v] contains [non-CoR member]>
say (join [The Chair of Republic] (join [us,] [we have cookies!]))
end
If you want some cookies, click or press the rickrolls.
There are three bands called stones: Rolling stones, trolling stones and rickrolling stones.

List of Scratchers I like and have left:
-TheGreenNinja-
the2000
GoldenEagleStudios
Rae-TV is going to be the next.
Endermangames2
Scratcher
18 posts

How do I remove part of an answer

Thank you

Last edited by Endermangames2 (Dec. 1, 2021 16:32:36)

Endermangames2
Scratcher
18 posts

How do I remove part of an answer

I implemented it, had to dump all the numbers into a list then join them together before putting it in a variable, but apart from that it worked really well! Thank you
PlatoHero_
Scratcher
500+ posts

How do I remove part of an answer

Endermangames2 wrote:

I implemented it, had to dump all the numbers into a list then join them together before putting it in a variable, but apart from that it worked really well! Thank you
No need to thank, just carry on with your project.

Shift + down to see the rest
when gf clicked
repeat until <not <[List of Scratchers v] contains [non-CoR member]>
say (join [The Chair of Republic] (join [us,] [we have cookies!]))
end
If you want some cookies, click or press the rickrolls.
There are three bands called stones: Rolling stones, trolling stones and rickrolling stones.

List of Scratchers I like and have left:
-TheGreenNinja-
the2000
GoldenEagleStudios
Rae-TV is going to be the next.
PlatoHero_
Scratcher
500+ posts

How do I remove part of an answer

Endermangames2 wrote:

I implemented it, had to dump all the numbers into a list then join them together before putting it in a variable, but apart from that it worked really well! Thank you
I changed the originall script so that you won't need lists.

Shift + down to see the rest
when gf clicked
repeat until <not <[List of Scratchers v] contains [non-CoR member]>
say (join [The Chair of Republic] (join [us,] [we have cookies!]))
end
If you want some cookies, click or press the rickrolls.
There are three bands called stones: Rolling stones, trolling stones and rickrolling stones.

List of Scratchers I like and have left:
-TheGreenNinja-
the2000
GoldenEagleStudios
Rae-TV is going to be the next.

Powered by DjangoBB