CSE 130 - Programming Assignment #2 FAQ

  1. Is using the ^ operation allowed?

  2. Yes.

  3. Can a function be tail recursive if it calls other recursively-defined functions that aren't tail recursive themselves?

  4. No.

  5. Getting the: "sh: 1: convert: not found" error

  6. Means you are missing ImageMagic. If you're getting this error on ieng6, please notify a TA. On Linux run 'sudo apt-get install imagemagick'. On other machines, see http://www.imagemagick.org/ for details on installing.

  7. Are there any restrictions on the inputs to our custom operators in 2C?

  8. Yes, all of the inputs are in the range [-1.0, 1.0]. This is specified in the assignment!

  9. How do I view an image from the terminal?

  10. Run the eog filename command. If you are ssh-ing into ieng6, makesure you passed the -X option to ssh.

  11. I (sometimes) get only ppm/pgm images. Whats wrong?

  12. ppm/pgm images are intermediary images generated by our code while evaluating your provided functions for each pixel. The fact that you only see the ppm/pgm files and no jpg files, indicates that your code failed while generating the image. Look through the output for any exceptions.

  13. In 2b) does the build function build expressions of exactly the specified depth, or may it build expressions with smaller depts?

  14. The specified depth is an UPPER bound. Your build function should also generate expressions that have branches of depth less then the passed in maximum.

  15. My function takes too long to generate images!

  16. Two things to check: 1) Are you passing in too large depths to build? You probably shouldn't go more than 20. 2) Does your build function alwas generate expressions of the maximum depth (see above q)?

  17. In 2b I get an 'Unbound module math' error.

  18. Use sin/cos etc instead of Math.sin, Math.cos

  19. build and build2 generating almost exactly the same image w/ same parameters

  20. Check whether the bounds on rand in build2 are such, so that it may return numbers causing your NEW custom operators to be returned

  21. Are seed1 and seed2 the numbers that determine the range of the return value of rand?

  22. No. seed1 and seed2 are passed to rand by our own code. You need to explicitly call rand inside build, build2 with the range in which you want the random number to be.

  23. Is image generation graded for time? How long do we have?

  24. Your code is given 5 minutes to generate each of the 6 pictures you are submitting. If it takes more than that we assume it timed out.

  25. Do we have to include all operators from build in build2?

  26. Yes. Specified in the assignment.

  27. All my pitures just have vertical (or horizontal) lines?

  28. Check the values passed to rand when selecting between varX and varY. Remember that (rand x y) generates a value in the range [x,y).

  29. Floating point numbers are truncated/off in the last digits compared to examples?

  30. Thats fine.