This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2012-05-24 15:09:29

Laserjl
Scratcher
Registered: 2011-11-13
Posts: 19

Re: Support with your project

help with emenmy detection and movement


http://scratch.mit.edu/projects/Laserjl/2856013

Offline

 

#27 2012-05-25 09:56:24

arp95
New Scratcher
Registered: 2012-05-25
Posts: 1

Re: Support with your project

Hello mate
I am kinda stuck, i need to do a homework in my school and i am neewbie, i need some help. can you please help me out, even by a bit? this is the homework:
The application should consist of two scripts:
1.    A data input script
2.    A query script Data structures in Scratch are very basic. Apart from variables, there is another structure called the list, which is a table in which elements can be stored. It is not the list with its pointers that was discussed in the lecture. We will have a list to contain the data and another list to contain the result.

Start by making (in the 'Variables' section) two lists: Countries and Result.
Note: In Scratch, to get helpful information on what a block will do, right-click on the block and choose help.

Code an input script to input values into the Countries list. Use a sprite to code the input script. Your script should ask for a continent-country pair from the user. Continent is a two-letter code (af for Africa, am for America, as for Asia, eu for Europe, au for Australia). After the two-letter continent code, there is a space character followed by the country name. For example, the user input could be 'eu Holland' or 'af Nigeria'. Insert the user input into the Countries list. To indicate end of the input session, the user can specify 'End' instead of the continent code. If the user does not specify an end-of-input, your script should repeatedly ask for the next continent-country pair. For example:

Countries
1     as China
2    eu Italy
3    eu Spain
4    af South Africa
5    am Argentina

The query script should ask for a continent code (the two-character code) and fetch all countries in that continent. Use a different sprite (e.g., a Dog) to code your query script. The query script will follow this sequence of steps: Initialize "Result" to be empty. Then, put a header in the first element of 'Result' of the form 'Countries in xx' (where xx is the continent code). Ask user for a continent code to query. Looping over all the elements of the Countries list, extract the first two letters in each element and compare the queried continent code to the continent code in each element (the first two letters you extracted) of Countries list. If an element in the Countries list matches, insert that element to the Result list.
For example, querying on 'eu' should produce the following:

Result
Countries in eu:
eu Italy
eu Spain

Well-designed procedures should include error-handling capabilities to handle invalid conditions. One of the obvious ones in this application is typing a continent code that is greater than two characters, which will fail future queries. Please add a simple error-checking code for this case in the input procedure as follows: If the third letter is not a space character ' ', issue a warning sound and a message that specifies an error. Other input error could also occur. But in order not to complicate the procedures, we do not ask you to check for these error conditions; yet, in real-life applications, they must be checked. In a text file, identify all potential human error conditions that are possible in this computer program and describe how you would handle them.
Computer programs should be easily readable by others. Adding comments to your code increases readability. Comment your code liberally. In Scratch, right-click on an empty spot on the Scripts area and choose Add Comment. Then drag your comment to the appropriate statement in your program.
To run each of your scripts in Scratch, click on the top of a script.

thanks a lot
alex

Offline

 

#28 2012-05-27 05:27:10

skeletonxf
Scratcher
Registered: 2010-11-02
Posts: 10

Re: Support with your project

I'd like some music for this project i'm making if you would be okay with that: http://scratch.mit.edu/projects/skeletonxf2/2567391 .
I'm not really sure about the genre that much, but I don't want lyrics and I kind of want the music to fit in with the graphics style.

Thanks.

I go on the forums only when I have to, and I don't know how to subscribe, so please reply on the project otherwise I won't see it.

Offline

 

Board footer