Activities/TurtleNutrition: Difference between revisions
Created page with "<noinclude>Turtle Nutrition</noinclude> 75px == What is Turtle Nutrition == Turtle Nutrition ... Turtle Nutrition is ..." |
|||
| (10 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
== What is Turtle Nutrition == | == What is Turtle Nutrition == | ||
Turtle Nutrition | Turtle Nutrition is a programmatic way to explore the nutritional content of the foods we eat. | ||
Turtle Nutrition is a fork of [[Activities/Turtle Art]] that . | Turtle Nutrition is a fork of [[Activities/Turtle Art]] that includes blocks to extract the nutritional content of food. These data can be used to plot charts, create formulas, calculate the nutritional content of recipes, and maintain a log of food eaten. | ||
[[File: | [[File:Food-plugin.png|300px]] | ||
=== Where to get Turtle Nutrition === | === Where to get Turtle Nutrition === | ||
| Line 17: | Line 17: | ||
=== How to use Turtle Nutrition === | === How to use Turtle Nutrition === | ||
[[File:TurtleNutrition-toolbar.png]] | Please refer to the [[Activities/Turtle Art]] pages for basic instructions on how to use the block interface and the details of various toolbars. | ||
[[File:TurtleNutrition-toolbar.png|800px]] | |||
;get calories: returns a number that corresponds to the number of calories in a food item | |||
;get protein: returns a number that corresponds to the amount of protein in a food item | |||
;get carbohydrates: returns a number that corresponds to the carbohydrates in a food item | |||
;calories eaten: the number of calories eaten | |||
;protein eaten: the amount of protein eaten | |||
;carbohydrates eaten: the amount of carbohydrates eaten | |||
;get fiber: returns a number that corresponds to the amount of fiber in a food item | |||
;get fat: returns a number that corresponds to the amount of fat in a food item | |||
;eat: consume a food item and add its nutritional content to the total amount eaten | |||
;fiber eaten: the amount of fiber eaten | |||
;fat eaten: the amount of fat eaten | |||
;digest meal: reset the nutritional content eaten to zero | |||
;get name: returns the name of a food item as a string | |||
;add food: (in versions 202.1+) the 'add food' block lets the user add new foods to the food palette | |||
[[File:TurtleNutrition-food-toolbar.png|800px]] | |||
;food blocks: various foods that can be used with the program. See below for instructions on how to modify the activity to add your own foods: apple, banana, orange, cake, cookie, bread, corn, potato, sweet potato, tomato | |||
In the example below [https://github.com/walterbender/turtleart/blob/nutrition/samples/nutrition-calorie-chart.tb], the "get calories" block is used to extract the number of calories in several foods. Those data are then used in a bar chart. | |||
[[File: | [[File:Turtle-Nutrition-calorie-chart.png|300px]] | ||
[[File:Turtle-Nutrition-calorie-chart|300px]] | [[File:Turtle-Nutrition-calorie-chart-es.png|300px]] | ||
== Learning with Turtle Nutrition == | |||
Most activities around learning about nutrition as based on the relaying of facts and advice. This activity offers a different approach: computation. | |||
forward get_calories banana | |||
== Extending Turtle Nutrition == | == Extending Turtle Nutrition == | ||
While it is not trivial to extend Turtle Nutrition, it provides a good opportunity for exploration. | |||
# Have the learners make lists of common foods | |||
# Make or find pictures of these foods | |||
# Look up the nutritional content of these foods: calories, protein, carbohydrates, fiber, and fat [https://www.choosemyplate.gov/SuperTracker/] | |||
# Create SVG images for the foods similar to [https://github.com/walterbender/turtleart/tree/nutrition/plugins/food/images] | |||
# Edit food.py [https://github.com/walterbender/turtleart/blob/nutrition/plugins/food/food.py#L211] to add your new foods to the food palette | |||
[[File:AddFood.png]] | |||
'''Note''': As of version 202.1, there is an "add food" block that will replace Steps 4 and 5 above. | |||
Feel free to ask for help if needed. | |||
== Reporting problems == | == Reporting problems == | ||
Please file bugs at [https://bugs.sugarlabs.org/newticket?component=TurtleArt]. | Please file bugs at [https://bugs.sugarlabs.org/newticket?component=TurtleArt]. | ||
To list all open tickets of Turtle | To list all open tickets of Turtle Nutrition, see [https://bugs.sugarlabs.org/query?status=accepted&status=assigned&status=new&status=reopened&component=TurtleArt]. | ||
== Credits == | == Credits == | ||
* Walter Bender wrote and maintains the code. | * Walter Bender wrote and maintains the code. | ||
* Brian Silverman is the first author of Turtle Art. | * Brian Silverman is the first author of Turtle Art. | ||
Latest revision as of 13:00, 19 May 2014
What is Turtle Nutrition
Turtle Nutrition is a programmatic way to explore the nutritional content of the foods we eat.
Turtle Nutrition is a fork of Activities/Turtle Art that includes blocks to extract the nutritional content of food. These data can be used to plot charts, create formulas, calculate the nutritional content of recipes, and maintain a log of food eaten.
Where to get Turtle Nutrition
http://people.sugarlabs.org/walter/TurtleNutrition-202.xo
How to use Turtle Nutrition
Please refer to the Activities/Turtle Art pages for basic instructions on how to use the block interface and the details of various toolbars.
- get calories
- returns a number that corresponds to the number of calories in a food item
- get protein
- returns a number that corresponds to the amount of protein in a food item
- get carbohydrates
- returns a number that corresponds to the carbohydrates in a food item
- calories eaten
- the number of calories eaten
- protein eaten
- the amount of protein eaten
- carbohydrates eaten
- the amount of carbohydrates eaten
- get fiber
- returns a number that corresponds to the amount of fiber in a food item
- get fat
- returns a number that corresponds to the amount of fat in a food item
- eat
- consume a food item and add its nutritional content to the total amount eaten
- fiber eaten
- the amount of fiber eaten
- fat eaten
- the amount of fat eaten
- digest meal
- reset the nutritional content eaten to zero
- get name
- returns the name of a food item as a string
- add food
- (in versions 202.1+) the 'add food' block lets the user add new foods to the food palette
- food blocks
- various foods that can be used with the program. See below for instructions on how to modify the activity to add your own foods: apple, banana, orange, cake, cookie, bread, corn, potato, sweet potato, tomato
In the example below [1], the "get calories" block is used to extract the number of calories in several foods. Those data are then used in a bar chart.
Learning with Turtle Nutrition
Most activities around learning about nutrition as based on the relaying of facts and advice. This activity offers a different approach: computation.
forward get_calories banana
Extending Turtle Nutrition
While it is not trivial to extend Turtle Nutrition, it provides a good opportunity for exploration.
- Have the learners make lists of common foods
- Make or find pictures of these foods
- Look up the nutritional content of these foods: calories, protein, carbohydrates, fiber, and fat [2]
- Create SVG images for the foods similar to [3]
- Edit food.py [4] to add your new foods to the food palette
Note: As of version 202.1, there is an "add food" block that will replace Steps 4 and 5 above.
Feel free to ask for help if needed.
Reporting problems
Please file bugs at [5].
To list all open tickets of Turtle Nutrition, see [6].
Credits
- Walter Bender wrote and maintains the code.
- Brian Silverman is the first author of Turtle Art.

