Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i get math questions with lists randomized?
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
You seem confused.
item 1 of questions list is 197-59
item 10 of questions is 9x5
So what do you think a random block with those as parameters is going to produce? The answer is 0 because it doesn't make sense to the block - it sees those as text strings so pick random ‘197-59’ to ‘9x5’ is complete nonsense. Are you just trying to choose one random item from the questions list? If soset [randomQ v] to (pick random (1) to (length of [question-list v] :: list))
and you use rendomQ to refer to the question annd answer = item randomQ of list.
where can i find that set block? and how do i get randomQ?
- deck26
-
Scratcher
1000+ posts
how do i get math questions with lists randomized?
I'm wondering if you need to spend some time on some more basic projects so you recognise things and understand the help you get here. There's no point trying to go too fast, you'll learn better if you do it in small steps and understand each step and get less frustrated. There is no shame in doing that and it doesn't mean we're being rude or discouraging you.You seem confused.
item 1 of questions list is 197-59
item 10 of questions is 9x5
So what do you think a random block with those as parameters is going to produce? The answer is 0 because it doesn't make sense to the block - it sees those as text strings so pick random ‘197-59’ to ‘9x5’ is complete nonsense. Are you just trying to choose one random item from the questions list? If soset [randomQ v] to (pick random (1) to (length of [question-list v] :: list))
and you use rendomQ to refer to the question annd answer = item randomQ of list.
where can i find that set block? and how do i get randomQ?
I think most Scratchers would immediately realise that the set block implies that is a variable being set to a value. The colour coding of the block virtually tells you that.
You asked about my reference to list1 in a previous response. You mentioned having a question list and an answer list but hadn't specified the names. Pseudo code is about expressing the idea in something that roughly resembles code. You wanted to randomise a pair of lists in tandem and I was showing you how to do that - the list names are not important in a general description of the process. So I just used the names list1 and list2 but the idea is you insert your own names when you write the code.
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
I'm wondering if you need to spend some time on some more basic projects so you recognise things and understand the help you get here. There's no point trying to go too fast, you'll learn better if you do it in small steps and understand each step and get less frustrated. There is no shame in doing that and it doesn't mean we're being rude or discouraging you.You seem confused.
item 1 of questions list is 197-59
item 10 of questions is 9x5
So what do you think a random block with those as parameters is going to produce? The answer is 0 because it doesn't make sense to the block - it sees those as text strings so pick random ‘197-59’ to ‘9x5’ is complete nonsense. Are you just trying to choose one random item from the questions list? If soset [randomQ v] to (pick random (1) to (length of [question-list v] :: list))
and you use rendomQ to refer to the question annd answer = item randomQ of list.
where can i find that set block? and how do i get randomQ?
I think most Scratchers would immediately realise that the set block implies that is a variable being set to a value. The colour coding of the block virtually tells you that.
You asked about my reference to list1 in a previous response. You mentioned having a question list and an answer list but hadn't specified the names. Pseudo code is about expressing the idea in something that roughly resembles code. You wanted to randomise a pair of lists in tandem and I was showing you how to do that - the list names are not important in a general description of the process. So I just used the names list1 and list2 but the idea is you insert your own names when you write the code.
i spent lots of time on scratch and have 50+ projectys and i have made code complex enough to almost match how hard this is!
- deck26
-
Scratcher
1000+ posts
how do i get math questions with lists randomized?
i spent lots of time on scratch and have 50+ projectys and i have made code complex enough to almost match how hard this is!But this isn't hard! It's basic use of random blocks and list handling.
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
i spent lots of time on scratch and have 50+ projectys and i have made code complex enough to almost match how hard this is!But this isn't hard! It's basic use of random blocks and list handling.
i never said it was i said about i did not say almost and i never said it was hard i was just comparing it to my other coding (and it sometimes is tricky to understand what block you mean)
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
I'm wondering if you need to spend some time on some more basic projects so you recognise things and understand the help you get here. There's no point trying to go too fast, you'll learn better if you do it in small steps and understand each step and get less frustrated. There is no shame in doing that and it doesn't mean we're being rude or discouraging you.You seem confused.
item 1 of questions list is 197-59
item 10 of questions is 9x5
So what do you think a random block with those as parameters is going to produce? The answer is 0 because it doesn't make sense to the block - it sees those as text strings so pick random ‘197-59’ to ‘9x5’ is complete nonsense. Are you just trying to choose one random item from the questions list? If soset [randomQ v] to (pick random (1) to (length of [question-list v] :: list))
and you use rendomQ to refer to the question annd answer = item randomQ of list.
where can i find that set block? and how do i get randomQ?
I think most Scratchers would immediately realise that the set block implies that is a variable being set to a value. The colour coding of the block virtually tells you that.
You asked about my reference to list1 in a previous response. You mentioned having a question list and an answer list but hadn't specified the names. Pseudo code is about expressing the idea in something that roughly resembles code. You wanted to randomise a pair of lists in tandem and I was showing you how to do that - the list names are not important in a general description of the process. So I just used the names list1 and list2 but the idea is you insert your own names when you write the code.
i spent lots of time on scratch and have 50+ projectys and i have made code complex enough to almost match how hard this is!
that still does not explain what randomQ means!?
- MeIzAwezomeDede
-
Scratcher
1000+ posts
how do i get math questions with lists randomized?
that still does not explain what randomQ means!?
randomQ is just the name of the variable, probably standing for “Random Question”
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
oh…ok thx!that still does not explain what randomQ means!?
randomQ is just the name of the variable, probably standing for “Random Question”
- caroteen
-
Scratcher
26 posts
how do i get math questions with lists randomized?
that just makes him ask a number between 1-20 i want him to ask the question!I'm wondering if you need to spend some time on some more basic projects so you recognise things and understand the help you get here. There's no point trying to go too fast, you'll learn better if you do it in small steps and understand each step and get less frustrated. There is no shame in doing that and it doesn't mean we're being rude or discouraging you.You seem confused.
item 1 of questions list is 197-59
item 10 of questions is 9x5
So what do you think a random block with those as parameters is going to produce? The answer is 0 because it doesn't make sense to the block - it sees those as text strings so pick random ‘197-59’ to ‘9x5’ is complete nonsense. Are you just trying to choose one random item from the questions list? If soset [randomQ v] to (pick random (1) to (length of [question-list v] :: list))
and you use rendomQ to refer to the question annd answer = item randomQ of list.
where can i find that set block? and how do i get randomQ?
I think most Scratchers would immediately realise that the set block implies that is a variable being set to a value. The colour coding of the block virtually tells you that.
You asked about my reference to list1 in a previous response. You mentioned having a question list and an answer list but hadn't specified the names. Pseudo code is about expressing the idea in something that roughly resembles code. You wanted to randomise a pair of lists in tandem and I was showing you how to do that - the list names are not important in a general description of the process. So I just used the names list1 and list2 but the idea is you insert your own names when you write the code.
i spent lots of time on scratch and have 50+ projectys and i have made code complex enough to almost match how hard this is!
that still does not explain what randomQ means!?
- deck26
-
Scratcher
1000+ posts
how do i get math questions with lists randomized?
that just makes him ask a number between 1-20 i want him to ask the question!
The point is that you want to know the number so you can ask the question and also identify the right answer. If you ask a random question without storing the number how will you know which is the right answer?
I think I did say to use it as the index for the list. So you'd ask the question
(item (randomQ v) of [question-list v] :: list)
and you know the answer is the corresponding item in the answers list.
Last edited by deck26 (Oct. 12, 2020 18:27:22)
- Discussion Forums
- » Help with Scripts
-
» how do i get math questions with lists randomized?


