Latest specification and accompanying files:
Why are there so many variables passed into createPkmn?
These variables should have values read into them while still in main.c, and then when createPkmn is called, they should have values in them. This is so that createPkmn can be tested without the use of standard input.
What's the format for entering Pokemon details?
Id: 007
Name: Squirtle
Height: 0.51
Weight: 9
Type: 17
Type: -1
Note: The name of Pokemon is a single word.
What's the format for entering which Pokemon to jump to? (For function jumpToPkmn)
Prompt for the id to be entered.
For example:
Id: 007
What's the format for entering the seed, factor and number of Pokemon? (For function findPkmn)
Prompt for each value to be entered independently as shown below.
For example:
Seed: 5
Factor: 192
Number to find: 7
Is there a maximum length for the Pokemon's name?
Yes (though you don't need to use it). It is 50 characters.
What input validation do we need to do?
None. This includes capital letters being entered as a command - it won't happen.
How do we format the display for the Pokemon details, if the Pokemon has more than one type?
Id: 041
Name: Zubat
Height: 0.79m
Weight: 7.50kg
Type: Flying/Poison
The types should be listed like this in alphabetical order, regardless of the order in which they were entered when creating the Pokemon.
Are we allowed to use other libraries, such as string.h?
You may include string.h and use any functions it provides, unless the specification for a specific function says you may not use string.h functions.
Do we print the Pokemon List in a specific order?
Yes. Print the Pokemon List in the order in which the Pokemon are stored in the list.
If an unfound Pokemon has 2 types, how should it be displayed?
Type: --
More output formatting details:
3 Pokemon found.
No Pokemon in list.
#007 Squirtle --> #008 Wartortle --> #009 Blastoise
#007 Squirtle --> #008 ********* --> #009 Blastoise
#007 Squirtle --> #008 Wartortle --> #009 ?????
#008 Wartortle --> #009 ?????
#007 Squirtle
Input format for Evolutions?
Id of original Pokemon: 007
Id of evolution: 008
What do we do if asked to add a Pokemon which is already in the list? (Or one with the same id.)
When adding a Pokemon to the list, if there is already a Pokemon in the list with that id, the new Pokemon should not be added to the list. (No error message or output is needed.)
Can we use ctype.h library for Stage 5?
Yes.
How will Stage 5 be marked?
We will be calling these functions in isolation, along with your printList function. You can add extra commands to main.c if you'd like and use that to test it. We don't mind (you won't lose marks for having extra commands in main.c).
Can a Pokemon sometimes evolve into more than one new Pokemon?
No.
How many decimal places should height and weight be printed in? How do we do this?
Height and weight should be printed to 2 decimal places. You can do this either by storing the number of cm, and then printing height/100, the decimal point, then height%100. Or you can store the number of metres and use printf("%.2f", height).
If a Pokemon has only one type, how should the type be displayed?
If a Pokemon has only one type:
Type: Bug
If a Pokemon has two types:
Type: Bug/Poison
What order should the names be displayed in the produced list in searchByName function?
Same order as the appear in the original list
Should searchByName/getPkmnOfType functions only extract found Pokemon or any Pokemon that matches the criteria?
Any pokemon that matches criteria should be extracted and placed into the new list. The fact that it hasn't been found should be preserved in the new list as well.
Stage 5 - Search by Name. What order should the returned list be?
Same as original list.
Sample solution uses srand/rand to generate random numbers. If you have a mismatch in output, try using the same function.
Resource created Saturday 24 September 2016, 10:01:32 AM, last modified Monday 17 October 2016, 10:44:33 AM.