?

Log in

No account? Create an account

mctcstudents

Anyone having trouble with Assignment 6, problems 5 6 and 7?...

Mar. 7th, 2006 | 03:30 pm
posted by: soullesshippy in mctcstudents

or is it just me?

Using the accumulate code from the book, writing the lambda functions I seem to get lost in the conceptualization, ie what am I trying to do?

For #5, I did get the redefinition of append to work easily, but my attempts on the redefinitions for map and length, in addition to the horner-eval for #6 have gone poorly shall we say. Haven't even tried problem #7 with count-leaves since, just like #6, it builds on #5 which is where my unsuccess began.

,Troy

Link | Leave a comment | Share

mctcstudents

For anyone interested in simple graphics in DrScheme...

Feb. 26th, 2006 | 03:22 am
posted by: soullesshippy in mctcstudents

I just found some stuff to play with. Look in the Help, in the "Find docs for:" searchbar at the bottom, enter "viewport graphics" to bring up lots of details on DrScheme/PLT's simple graphics library.

here's some starter code to play with.



;include graphics library
(require (lib "graphics.ss" "graphics"))
;start graphics library
(open-graphics)

;make some constants
(define wid 200)
(define hite 200)

;create a viewport
(define v1 (open-viewport "v1" wid hite))

;draw pixel at x, y, black, or you can use white
;((draw-pixel v1) (make-posn x y)) "black")
;same as above, but use random x, random y
;((draw-pixel v1) (make-posn (random 200) (random 200)) "black")

((draw-pixel v1) (make-posn 100 100) "black")

Link | Leave a comment | Share

(no subject)

Feb. 22nd, 2006 | 12:29 am
posted by: jonnyh in mctcstudents

Just in case nobody notices my message as the accidental reply to another message, I am rewriting it here.

Hey. Just joined. I thought someone might find this source interesting. I got it from:
http://www.daniweb.com/techtalkforums/post48832.html#post48832

It works in scheme (assuming you can copy/paste it alright after it posts). It creates some frames and some buttons and does some simple UI stuff. If it doesn't work right after posting, just go to the site I got it from and copy/paste it from there.


(define start (instantiate frame% ("Welcome to the land of land")(x 150)(y 150)(height 300)(width 500)))
(define line1 (instantiate message% ("You find yourself in a room. In this room are a wand and a sword." start)))
(define line2 (instantiate message% ("Obvious exits are North and South. Areas of the room may be hidden." start)))
(instantiate button% () (label "Pick up sword")(parent start)
(callback (lambda (button event) (send sword show #t)(send start show #f))))
(instantiate button% () (label "Pick up wand")(parent start)
(callback (lambda (button event) (send wand show #t)(send start show #f))))
(instantiate button% () (label "Search the room") (parent start)
(callback (lambda (button event) (send gos1 show #t)(send start show #f))))
(send start show #t)
(define sword (instantiate frame% ("You have the sword in hand...")(x 150)(y 150)(height 300)(width 500)))
(define sl1 (instantiate message% ("The sword is heavy, but you know you can wield it in combat." sword)))
(define sl2 (instantiate message% ("Which exit will you take?" sword)))
(define wand (instantiate frame% ("You have the wand in hand...") (x 150)(y 150)(height 300)(width 500)))
(define wn1 (instantiate message% ("You fell great power as you pick up the wand..." wand)))
(define wn2 (instantiate message% ("But the moment is ruined as you fart loudly." wand)))
(define gos1 (instantiate frame% ("Darn but your stupid...")(x 150)(y 150)(height 300)(width 500)))
(define gos1m1 (instantiate message% ("You search the room, setting off several traps. You dead!" gos1)))

Link | Leave a comment | Share

mctcstudents

It seems that...

Feb. 2nd, 2006 | 11:23 am
posted by: soullesshippy in mctcstudents

in order to leave an initial comment, you do need to log in / have a LiveJournal account.
You can reply to someone else's comment w/o logging in, using anonymous.
I just realized this, and it may make this avenue less attractive to some.

Creating a LiveJournal account is relatively quick and painless though, just look at the topright of the screen where it says LogInNow, beneath it is a link to Create account, for those still interested in participating.

Sorry, I just became aware of this nuance today.
,Troy

Link | Leave a comment {3} | Share

mctcstudents

Well...

Jan. 28th, 2006 | 12:50 am
posted by: soullesshippy in mctcstudents

I'm throwing this together so that, if needed, my classmates and I can come together and ask each other questions about our Scheme homework for Ed Seifert's CSCI 1901 class.

Feel free to ask questions here, I'll try to get this address to everyone else (all 5) in our class so they can possibly benefit/contribute. I figure one hour in lab a week to ask each other questions may not be enough time as the assignments grow more complicated.

To respond to a comment here, click on "Leave a Comment". To post a new message, click on User Info on the left, and then the 2nd icon in the row of icons on the page that loads, it's a blue pencil and its mouse-over reads "Post".

Having a LiveJournal account is optional, you can post anonymously every time and just include your name in the post.

,Troy

Link | Leave a comment {3} | Share