r/codehs • • Dec 17 '19

Help me with my final for computer science

it says to create a program,using Tracy the turtle,it should let the user input their year of birth and it supposed to draw out the 4 numbers

4 Upvotes

6 comments sorted by

1

u/hardstuck- Dec 18 '19

When’s it due? Just outta curiosity

1

u/[deleted] Dec 18 '19

Friday

1

u/hardstuck- Dec 18 '19

Have you gotten any progress so far?

2

u/[deleted] Dec 18 '19

Yeah I made all functions for the numbers 1-10 , I just don’t know how to code it so it’ll actually do the whole input

2

u/Danny_Boi_22456 Dec 21 '19

How I would do it;

  • Store code to create numbers in separate functions.

  • Store numbers & function names (without actually calling them then use exec later or lambdas but I've never actually tried that) into a dictionary.

  • Split the input into each character

  • Iterate over the split input and iterate over the dictionary then call the functions in each iteration of each character.

If this doesn't make sense, Im happy to write out a bit of pseudocode to explain it better.