Design key-f function which takes list-of-shapes and keyEvent and produces a list-of-shapes. The function checks the key event. If keyEvent is "s" then create a new shape as "square" and produce random colored shape with random size (between 0-30) and random position where x is between [0,WIDTH] and y is between [0,HEIGHT]. If keyEvent "c" then create a new shape as "circle" or if keyEvent is "t" then create a new shape as "triangle".
Don't know anything about that language but this sounds like you just have a list with all the shapes to draw and keep adding randomly generated ones when any one of those 3 keys is pressed. I suppose that you can make lists in that language, or use classes and manually build some double linked list structures that contain those "shape" structs and pointers to other elements.
Design mouse-f function which takes list-of-shapes, x, y and mouseEventand produces a list-of-shapes on scene. The function checks themouse event. If it is \button-down", change the locations of all theshapes to align through a line around the clicked point
The first part sounds like displaying the content of the list near where the mouse button is being held down.
The second part is too vague.
Best of luck.
Comment has been collapsed.
I hope you don't me entering despite my inability to help you in Racket!
Bump! 😊 👍
🎅🎄🎁 𝓜𝓮𝓻𝓻𝔂 𝓒𝓱𝓻𝓲𝓼𝓽𝓶𝓪𝓼 🎁🎄🎅
Comment has been collapsed.
I'm afraid that I have no knowlegde of racket.
Have you tried posting your question on stackoverflow? That's usually where I go to when stuck on something stupid code-wise.
Comment has been collapsed.
Ah, a little tip with stackoverflow. If it's a college project, they won't help you if you haven't posted enough info to prove that you've made a decent attempt to solve it yourself. Then they'll look at your code and tell you where you're going wrong. They won't give you the answer if you just post a question. That's generally how I get help if I'm stuck, otherwise, your question generally gets ignored. XD
Comment has been collapsed.
I think you are right, i posted about the question but i didn't post the codes i wrote. I almost wrote everything but there was somethings that wouldn't work with each other. For example, when i run the app the first function wont' work with the last function, and it got me crazy :D -- i had some help and now the project is completed :D
Comment has been collapsed.
Oh, I know how you feel. I had to do my final project in React Native to create a cross-platform iOS/Android app. I never actually used it before. Professor was like "well, you might as well learn something new while you're doing this." It wrecked my head, but it was fun at the same time. lol.
Some of the people on stackoverflow are teachers themselves. They just want people to learn and don't want to give answers without you first proving what you did. That is understandable. It doesn't help the student if they can just get the answer online. :)
Comment has been collapsed.
Damn I don't know anything about it. But thanks for the giveaway
Comment has been collapsed.
i came for ga cuz i am bad with coding. Thanks and sorry!
Comment has been collapsed.
111 Comments - Last post 9 minutes ago by quijote3000
87 Comments - Last post 12 minutes ago by nvcstudent210
290 Comments - Last post 41 minutes ago by sensualshakti
368 Comments - Last post 45 minutes ago by sensualshakti
81 Comments - Last post 1 hour ago by dondazero
346 Comments - Last post 3 hours ago by TheTimmaeh
46,808 Comments - Last post 5 hours ago by Pageplant
420 Comments - Last post 19 minutes ago by freshduke
110 Comments - Last post 23 minutes ago by MoonQueen3
2,674 Comments - Last post 28 minutes ago by Mhol1071
157 Comments - Last post 31 minutes ago by MoonQueen3
10,347 Comments - Last post 38 minutes ago by DrPower
5,686 Comments - Last post 53 minutes ago by Furty
120 Comments - Last post 1 hour ago by inmate66
Hello steamgifters, it's been a lot since i used the website, i had a lot going on and the university + part time job taking my time.
I have a project in Racket programing language, i tried to solve it but i wasn't able to, i am so desperate about it that's why i am posting it here.
Thanks in advance for passing by, here take this small gift
-----Questions----------
It's about designing a simulation using DrRacket big-bang environment. I have a structure that got:
; size is the size of shape
; color is color of shape
;type is form of shape
; posn is a posn structure and gives the location of shape
;structure:
$ (define-struct shape (size color type posn))
;constructors:
$ (define b1 (make-shape 10 "red" "c" (make-posn 450 350)))
$ (define b2 (make-shape 15 "green" "t" (make-posn 150 150)))
$(define b3 (make-shape 10 "purple" "c" (make-posn 250 200)))
$ (define b4 (make-shape 20 "orange" "s" (make-posn 320 450)))
$ (define b5 (make-shape 20 "blue" "t" (make-posn 280 300)))
Design key-f function which takes list-of-shapes and keyEvent and produces a list-of-shapes. The function checks the key event. If keyEvent is "s" then create a new shape as "square" and produce random colored shape with random size (between 0-30) and random position where x is between [0,WIDTH] and y is between [0,HEIGHT]. If keyEvent "c" then create a new shape as "circle" or if keyEvent is "t" then create a new shape as "triangle".
Design mouse-f function which takes list-of-shapes, x, y and mouseEventand produces a list-of-shapes on scene. The function checks themouse event. If it is \button-down", change the locations of all theshapes to align through a line around the clicked point
That's all what left from the project, thank you so much guys.
Comment has been collapsed.