Scratch Lists | How to Use Lists in Scratch 3.0 Example

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 134

  • @SurfingScratcher
    @SurfingScratcher  5 лет назад +19

    SCRATCHY QUESTION: What are lists called in some other programming languages that you know?

    • @Mutatedordinary
      @Mutatedordinary 5 лет назад +10

      Arrays

    • @SurfingScratcher
      @SurfingScratcher  5 лет назад +5

      @@Mutatedordinary Niiice, Wyatt! 🙌 In which programming language have you found arrays?

    • @Mutatedordinary
      @Mutatedordinary 5 лет назад +6

      Surfing Scratcher java, python

    • @Senneih_cram
      @Senneih_cram 4 года назад +4

      @@SurfingScratcher i learned html, i'm so advanced xDD

    • @three-0917
      @three-0917 3 года назад +2

      I need help how would you make a list where to sprite ask what name or contact you want and then you put your answer in. Then it would search that name up and put all of its info on the screen like their phone number?

  • @emily1729
    @emily1729 4 года назад +24

    I'm a student in college and this video really helped me, thank you so much! :)

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +5

      Unreal, Emily! I've had a couple of college students post like you :) Scratch and visual programming is such a useful step before transitioning to a text-based programming language. Keep at it and I wish you well with your coding journey :)

    • @HeroFigo
      @HeroFigo 4 года назад +3

      First of all. Is scratch used in colleges? And second of all. Can i use lists to make a rewind system? Like when i press "d" i go 1 step forward and i add x position to the list then i re read the list backwords. Is that possible?

    • @daansprinkhaan9635
      @daansprinkhaan9635 3 года назад +2

      @@HeroFigo E

    • @HeroFigo
      @HeroFigo 3 года назад +2

      @@daansprinkhaan9635 a bit late but it's ok

    • @HolahkuTaigiTWFormosanDiplomat
      @HolahkuTaigiTWFormosanDiplomat 3 года назад

      @@HeroFigo It can be used across the age.

  • @sirsalty8587
    @sirsalty8587 4 года назад +34

    This is sad because scratch is for kids and I’m in comp sci 1 and cant even do this right

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +24

      Hi glitchy, thanks for sharing a comment. There would be people in their 20s, 30s, 40s, 50s ... you get the idea who "can't even do this right", but who cares? It's all about YOUR learning journey. The only person you need to compare yourself to is the person you were yesterday. Be better than that person and your understanding will grow with perseverance and grit. You got this, bud!

    • @RealGameTitan
      @RealGameTitan 4 года назад +4

      @SaltyAzn, while Scratch is accessible for kids, I wouldn't say it's only "for kids." There are also meaty computer science topics like concurrency ruclips.net/video/ex0YW9voQKo/видео.html optimization and more that you can explore.

  • @judeposey2395
    @judeposey2395 2 года назад

    wow, this helps a lot!! ive been wanting to stop watching youtube tutorials cause i dont feel like im leareing nothing, so i came to u!! thx!!

  • @junjomo7891
    @junjomo7891 3 года назад +1

    Man thank you so much bro, I gotta use lists for a project for a teacher who doesn’t know anything. So you just saved my ass

  • @avbergman9808
    @avbergman9808 5 лет назад +5

    Wow, good tutorial! Please don't stop uploading tutorials!

    • @SurfingScratcher
      @SurfingScratcher  5 лет назад +1

      Hi AV, I feel joyful when I hear that you value these tutorials as contributing to another's learning journey nourishes me. The plan is to release a video each week, and I'm open to suggestions for videos that my subscribers would find useful 🙌😄

    • @avbergman9808
      @avbergman9808 5 лет назад

      @@SurfingScratcher Cool! Can you make a tutorial how to use the other moderators that you didn't show in your tutorial.

    • @SurfingScratcher
      @SurfingScratcher  5 лет назад +1

      @@avbergman9808 Yep, that one is on the todo list. Hopefully release it over the next month 🤙

  • @avbergman9808
    @avbergman9808 5 лет назад +2

    Wow, you are good making tutorials, i dont know why you not have more subsuribers!

  • @ArnavBoom
    @ArnavBoom 3 года назад +1

    Fanally someone who dowsn't just have begginers, but also advanced tutoriels on something, but I have to start with the basics first

  • @andrewyang5369
    @andrewyang5369 4 года назад

    i was looking for this!

  • @CosmicAviplayz
    @CosmicAviplayz 2 года назад

    Thanks

  • @nathanmullings4672
    @nathanmullings4672 2 года назад +1

    you under explained everything. I've been trying to figure out how to use lists for a while now and I don't think there is a video on RUclips that can do it the right way

    • @SurfingScratcher
      @SurfingScratcher  2 года назад

      Thanks for your comment :) What do you think is missing Nathan?

    • @nathanmullings4672
      @nathanmullings4672 2 года назад

      @@SurfingScratcher thanks for the reply. I'm mostly confused about how lists end up linked to sprites or other stuff. So far I don't know how to get lists interacting with anything other than itself.

    • @SurfingScratcher
      @SurfingScratcher  2 года назад +1

      ​@@nathanmullings4672 Imagine you've got an exercise book to take notes in order to store information that you want to remember. In that example, the book is the list (with many page numbers that you can reference) and you're the sprite.
      In Scratch, you can't directly get a list to communicate with a sprite. A sprite can change a list's values, just like you can erase some notes in your book. A sprite can also read values in a list, just like you can read your book notes.
      In order to 'listen' to see if a value has changed, you must use a loop of some kind to keep checking it. If the value has changed, then you can broadcast an event message to any other sprite that wants to know about it. It's like your friends wanting to know if you've updated a section of your book so that they can change theirs as well.
      Hope that helps!

  • @EHMM
    @EHMM 2 года назад

    also can be work-arounded with (0)>

  • @tigerpan409
    @tigerpan409 4 года назад

    Thank you for explaining to me

  • @amazingict1
    @amazingict1 4 года назад

    This is impressive. Well done. Richard UK

  • @WhiterDarkness
    @WhiterDarkness 4 года назад

    Very good explanation!

  • @michaelajohann6300
    @michaelajohann6300 3 года назад +3

    Thank you really much! It helped me a lot! I learn Python,HTML and C++. In Python lists are called “lists” too, but you can use “Tuples” and “sets”. But I have a question: For what can you use lists in Scratch? Thanks for an answer in advance! Best regards!😊😊

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +2

      Thanks for your comment, Clara! Lists in Scratch are not as flexible as those in Python. But they are useful to keep track of groups of data. You may want to keep track of the x,y coordinates of clones, you may wish to track answers to a multiple choice quiz or maybe you want to do some pathfinding. They have many uses and they are there at your disposal to make your code more organised and readable.

    • @michaelajohann6300
      @michaelajohann6300 3 года назад +1

      @@SurfingScratcher Okay,thank you!

  • @nokkitisaro1533
    @nokkitisaro1533 5 месяцев назад

    Thx

  • @yyhhttcccyyhhttccc6694
    @yyhhttcccyyhhttccc6694 Год назад

    thanks i used this for a neural network

  • @sankalpdubey6750
    @sankalpdubey6750 3 года назад

    I am a 10 year old kid. Thanks this really helped

  • @Senneih_cram
    @Senneih_cram 4 года назад +1

    thx man, i'm tryna do a command where it detects wich sprite is the nearest of another sprite and this might be usefull

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +1

      Thanks for sharing, Not Frisk. Yep, I reckon lists will serve your need there. I reckon your solution lies with the 'distance to' block and lists along with iterating over that list using some kind of repeat block ;)

    • @ziggyzoggin
      @ziggyzoggin 3 года назад

      yah, just add all the distances to the list after clearing the list, then do a loop for the length of the list with a counter variable checking which is smallest.

    • @Senneih_cram
      @Senneih_cram 3 года назад

      It actually will be a turn based game with this function so id need a repeating block lmao

  • @jeanlucfunck
    @jeanlucfunck 5 месяцев назад

    hi, min 2:14... appeared the STACK BLOCK, I looked all over google, no explanation of this type square block, thx

  • @P4Trooper
    @P4Trooper 2 года назад

    how can you make a clone be hooked up to one thing on the list?

  • @momchilmichaylov27
    @momchilmichaylov27 2 года назад +2

    Hi! Can we influence how many lines of the list are shown at a certain moment? For ex. I need to show the superpowers gained just at the levels of a game so far
    Using several lists for that would increase the code too much

    • @Iamagoodperson
      @Iamagoodperson Год назад

      Unfortunately, no but you can delete and add items to the list so that should work the same way as showing certain lines of a list. For example, you can add the superpower "jump high" when the player goes to level 3 and delete it using the "delete x of list name when the player goes to level 4.

  • @isaacsdreamyworld9093
    @isaacsdreamyworld9093 Год назад

    I'm having trouble to add a specific amount of items on my list eg: repeat 10 times, add item (thing) to list. It keeps adding less then I coded it to, is there a way to fix this?

  • @ziggyzoggin
    @ziggyzoggin 3 года назад +1

    lol, the first time i saw lists i was looking in an advanced project and saw the list category. i'd never seen it before since it only appears if you create a list. and i thought they were functions, since they have similar coloring. i was like "how did this person make bubble and boolean functions?? how do i do it?"

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +1

      Thanks for sharing your first experience of lists, Ziggy. It is strange that the blocks appear only after you create a list. 🤷‍♂️

  • @MsVallies
    @MsVallies 4 года назад

    Thank you so much< can I ask you question a bout list in scratch?

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      Hi Valleys, thanks for your comment. Of course, ask away!

  • @ice9tom
    @ice9tom 2 года назад

    lists are arrays? Any idea how to create a input field so that I can add a value to the list such as 'page number'?

    • @SurfingScratcher
      @SurfingScratcher  2 года назад

      You'll need to use the ask and wait block in the sensing category. Find the 'answer' block to use the results and input into your list.

  • @amychittenden8993
    @amychittenden8993 3 года назад

    I can't find in 3.0. It is in a Scratch Wiki, but I don't see it on this video and I don't have it in my projects. I asked on the Scratch Discussion page, but the only response I have gotten so far is that it is still there. That doesn't help. Where is it? I also notice in the wiki that there is a

  • @binnysrivastava3515
    @binnysrivastava3515 3 года назад

    Hi, Is it possible to select a item in the list and play music accordingly?

  • @llamafromspace
    @llamafromspace 3 года назад

    At 3:20 how did you assign the sprites the list numbers?

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      Hi Lana, thanks for your question. If you're talking about the graphic, I just manually matched them up based on their costume numbers.
      If you're referring to the list itself, Scratch will automatically do the assigning for you when you add items to the list unless you specify a position.

  • @bondry77fullgames85
    @bondry77fullgames85 3 года назад

    How can i get a better resolution on my scratch project? Not to layers. I want to my project . Thank you in advance

  • @MelissaHarrismelement
    @MelissaHarrismelement 4 года назад

    Cool

  • @ivydragon109
    @ivydragon109 3 года назад +1

    Thanks for sharing! Is it possible to store sounds or costumes in a list? I'm trying to create a speaking clock (which speaks out the time) but using 100 if statements is no fun and makes the project meaningless.

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +1

      Hi Heng, it's only possible to store text and numerical values at the time of writing. A suggestion could be to use the text-to-speech plugin in combination with lists. That way, you can use the item number's of the list to locate the text you wish to speak. You can use multiple lists to help you with this with phrases like quarter-to and quarter-past.

    • @ivydragon109
      @ivydragon109 3 года назад

      @@SurfingScratcher Thank you so much for your advice! I'll definitely try it out. :)

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      @@ivydragon109 While it's not the exact solution you are looking for, I made a video a while back that uses a Makey Makey to tell the time with the text-to-speech function. ruclips.net/video/n_JQpNppI0w/видео.html

  • @memexo1751
    @memexo1751 4 года назад +1

    could you please help me on how to calculate and count how many common values between two lists? I'm having a lot of troubles with it

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +1

      Hi meme xo, thanks for posting your question. I'd probably use a variable and cycle through each list. I'm assuming that each list has unique values within itself. So let's say you get the value of item 1 and it's value is 'awesome'. You want to find the number of 'awesome's in list 2. You could use a variable called awesome count. Cycle through list 2 and when value == 'awesome' change awesomeCount by 1.
      .
      .
      Alternatively, you can make this more dynamic by cycling through each item in list 1 and storing that in a variable so that you can compare values in list 2. You could then create a third list that contains the counts of the common values between each list at the item location specified in list 1.
      .
      .
      What I've just described might be a bit confusing to understand. Let me know what values (text or numbers) you're trying to compare and I can perhaps make a quick video on it.

    • @memexo1751
      @memexo1751 4 года назад

      @@SurfingScratcher thank you so much for the quick response I really appreciate it. so what you mean is that I make a loop and put a constant variable from the first list and then let it check if it's in each variable In the second list. I've tried with a lot of ways but it never worked with me, I'm totally okay with texting you just let me know when is the perfect timing for you. thank you again

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +1

      @@memexo1751 Hi meme xo, I've just created a sample project on Scratch for a reference. Have a look at it. scratch.mit.edu/projects/414920929/

    • @memexo1751
      @memexo1751 4 года назад

      @@SurfingScratcher IM SO GRATEFUL thank you so much for the help and I will try to use this code to the program. so helpful

  • @suvidhpawar3551
    @suvidhpawar3551 2 года назад

    SCRATCHY Question how to divide variables to lists

  • @ayz1390
    @ayz1390 3 года назад

    how do you add so many boxes in a single sprite??

  • @Gameriam100
    @Gameriam100 2 года назад

    How to link 2 list together.

  • @ok_scratch10
    @ok_scratch10 3 года назад

    question(nice vid btw):How Do i move and generate a @ in a 64(x)x9(y) world full of # and the @ can stand on any # (the # generator is already done)

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      HI Ok_scratch10, thanks for your question. Are we talking about lists or something else? If something else, I'm not sure that I'm on the same page as you so can you explain the context a little bit more? Thanks.

  • @hannanahmed2810
    @hannanahmed2810 2 года назад

    How we can separate even and odd values from the list?
    Please reply

    • @SurfingScratcher
      @SurfingScratcher  2 года назад

      Your friend is the modulo operator. Watch my video on operators in scratch to help you understand.

    • @hannanahmed2810
      @hannanahmed2810 2 года назад

      @@SurfingScratcher Share the link please

  • @unknown-wr5pn
    @unknown-wr5pn 3 года назад

    i made a dairy //chat for youself because of this

  • @dhariyalshubham
    @dhariyalshubham 4 года назад

    I need help with the following on Scratch:
    1- How to use select multiple option features such as: "Yes or No".
    2- How do I use the following process:
    Example: If A asks a question B select Yes or No, If B select Yes then one condition/flow will occur, and if B says No then the flow will be different.
    Let me know if someone helps me... I just started CS50.

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      Are you using the 'answer' reporter block from the sensing category? If so, something like the following should do the trick...
      If answer == Yes
      ... do process
      If answer == No
      ... do process

  • @ARRABELA1
    @ARRABELA1 4 года назад

    Hi, could you help me with the carthesian Product of a set whith his-self? A x A = { (a1,a1), (a1, a2), ... (an, a1), (a2, an) }

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      Hi Maria, thanks for posting your question. This is beyond my boundary of accessible knowledge at present, but I'll leave you with a couple of video links that may help you.
      Cartesian Sets intro: ruclips.net/video/_IUP114x2gM/видео.html
      Seems to be a python representation of cartesian product: ruclips.net/video/JH2EJoVKax8/видео.html
      I'm making the assumption here, that you can just substitute the second set as the same set for your specific example, but that could be inaccurate. Speak to your course tutor/teacher for more specific help. They'll want to support you :)

  • @JoshCartman
    @JoshCartman 4 года назад

    I'm having problems with a program I'm creating. I've got Asteroids floating from right to left, i want to make sure they start at a different Y-Position, like a distance of 30. If I have 4-6 going at one time, is lists a good way to make sure they disperse separately? I'm trying with lists but this is making no sense. I swear, if I did this in Java, it would be easy.

    • @SurfingScratcher
      @SurfingScratcher  4 года назад +1

      Scratch can seem a little backwards. Lists are just like arrays. The block you're looking for is in the operators category. You can 'pick random' between a range. So then when your asteroid starts as a clone, you can place at a random position. If you don't want the asteroid to be 'on top' of another asteroid, you could use a sensing block with a repeat until block.
      Repeat until NOT touching asteroid,
      set Y random position between ... & ...
      Hopefully that pseudocode can get you on the right path. You can also use lists to track the y positions, but you may not need to either.

  • @caseofkc2170
    @caseofkc2170 2 года назад

    Great tutorial! ^^ I would like to ask for assistance though...is it possible to use lists to limit values input by the user? Or is there another method used for that? Like, the code asks for their name, can I use lists (EDIT: create a list of the "forbidden" characters and symbols the user isn't allowed to input) so that inputting a number or any symbol other than a letter will prompt the command to keep asking their name until they input a letter-only value? Thanks so much in advance!

    • @SurfingScratcher
      @SurfingScratcher  2 года назад +1

      Lists are for storing values. Validating user input is done by if blocks and operator blocks.
      You could store a list of forbidden characters in a list. Then use the if condition to check to see if the user input contains a character in the list.

    • @caseofkc2170
      @caseofkc2170 2 года назад

      @@SurfingScratcher ​ @Surfing Scratcher I never got to reply to this but thank you so much! It worked--was able to use lists to validate user inputs and restrict them from inputting certain characters :> Keep making videos, they're all so helpful

  • @siddhiswisdom285
    @siddhiswisdom285 3 года назад

    Hi Surfing Scratcher, thx for this very entertaining tut. I wonder if its possible to prog twodimensional arrays in scratch? If no, is there a workaround? I try to prog a memorygame so I need always a pair of identical things on different positions on the screen. It would be more convenient to have twodim-Lists. What do you think? All the best

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      Hi Sid, multi-dim arrays/lists aren't an option by default. Best I can think of is to encode your list values as if they were holding items. So if you wanted coordinates, just always back it 6 digits with the first 3 representing x and the second 3 representing y. What's the data type of the values of the nested list?

    • @siddhiswisdom285
      @siddhiswisdom285 3 года назад

      @@SurfingScratcher Hi Surf, as you mentionded, I need coordinates. How can I encode a listvalue like -230 (x) 40(y) .As I understand I should write into the list -23040 or am I wrong? Thx Sid

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      ​@@siddhiswisdom285 You'd need to write a helper function (custom block) to help encode/decode the pair. You could use a delimiter like a comma like in a comma-separated list (csv) file.
      To encode, you'd use the join block in the operator's category. To decode, you would split the items based on the delimiter that you chose.

    • @siddhiswisdom285
      @siddhiswisdom285 3 года назад

      @@SurfingScratcher Great, Thx Surf

  • @bobcat1785
    @bobcat1785 2 года назад

    i just so confused why my list will not save

  • @mist3rtrixt3r
    @mist3rtrixt3r 3 года назад

    Great video, but i can't figure out how to make this work in Scratch for Discord. Can you please do a tutorial for how to make a list in discord? The issue is that the scratch for discord doesn't have all the same blocks as scratch.

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +1

      Oh cool. I didn't know that you could make Discord bots with Scratch blocks. At first glance, there looks like there is a list category. It's the fifth option down on the left-pane menu on this site: scratch-for-discord.netlify.app/
      If I get some time to play around, I'll make a video.

    • @mist3rtrixt3r
      @mist3rtrixt3r 3 года назад

      @@SurfingScratcher be sure you are using the latest version, I was looking at the older one and it was missing quite a few block categories. The new version has "embed" and "added" categories.

  • @aadurite
    @aadurite 4 года назад

    undertale scratcher here and i have a list of a bunch of attacks in a list for a template sans fighrt that i remixed (and custom blocks but i wanna know how to use the lists) so how, presumably, would i make them appear (there is already a custom block called custom attack where u snap all ur attacks under, which i have done with blocks.. but cant get the lists to work

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      Hi Adurite, thanks for your comment. What is it that you could like to do with the lists? Lists are used to store information. Are you wanting to store information in your lists? Are you wanting to read a value in your list?

    • @aadurite
      @aadurite 4 года назад

      @@SurfingScratcher it turned oiut that those blocks were just the original creator making something... then scrapping it.. (so they dont really work) even though there are values.. i searched all the code in the battle engine and it doesnt even use many lists (it only uses them for the width of the outline of a box)

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      @@aadurite I love two things about your process here Adurite: firstly, your willingness to reach out. Often scribing down your thoughts helps you on the path to solving your own problem. Secondly, the detective hunt you went on to work out the usage of lists. You found the smoking gun. Thanks for sharing your debugging success and insights!

    • @aadurite
      @aadurite 4 года назад

      @@SurfingScratcher le thank! while i might be able to just make the code for the lists from scratch its complicated due to how many costumes and scripts you need for just one healthbar

  • @mibsmartlearning9621
    @mibsmartlearning9621 2 года назад

    constants

  • @keithrogers7422
    @keithrogers7422 3 года назад

    Arrays

  • @jivitesh5114
    @jivitesh5114 4 года назад

    How to stack items in the lists?
    pls help me I want to make a game

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      Hi Jivtesh, can you expand on what you mean by 'stack'?

    • @jivitesh5114
      @jivitesh5114 4 года назад

      @@SurfingScratcher Like in minecraft you can store up to 64 blocks of one kind. Sometimes 16 blocks. Just like that.

    • @SurfingScratcher
      @SurfingScratcher  4 года назад

      @@jivitesh5114 Lists store text and numbers and you can have multiple lists. So you can think of the 'one kind of block' as text or numbers. Then you can have different numbers and different words.
      But in Scratch, you can't store a list inside a list.

    • @jivitesh5114
      @jivitesh5114 4 года назад

      @@SurfingScratcher Oh Ok. Thanks for explaining me. Now I can make rpg games with it.

  • @vedacookie890
    @vedacookie890 3 года назад

    hi

  • @anushreerai9258
    @anushreerai9258 2 года назад

    slistion

  • @mibsmartlearning9621
    @mibsmartlearning9621 2 года назад

    constant

  • @PROBS1
    @PROBS1 2 года назад

    Honestly, I DONT GET IT

  • @muhammadyahyaosman9447
    @muhammadyahyaosman9447 3 года назад

    Arrays