We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Need Help with writing one task
Page Index Toggle Pages: 1
Need Help with writing one task (Read 1298 times)
Need Help with writing one task
Feb 9th, 2010, 8:49am
 
Hello everyone!

Im pretty new to Processing but i've been given a task which i have to complete any day now. Ill write the part of it which confuses me the most, with hope that someone can explain me what exactly am i supposed to do and tip me with the methods to achieve it.

1) Develop a program that draws a square lattice of horiznotal and vertiocal light grey lines with a spacing of N pixels in a window of 700 by 500. ( so far everything is clear just wanted to introduce you to the task)

This is the part where i get confused:

- Then extend this program so that if the mouse button is pressed when the mouse button is close to a latice point then it gets from the keyboard a two-digit (e.g. 02,13,67) value. Interpret the two digit value, imput from the keyboard as the radius for circle to be drawn centered on the chosen lattice point. If any value imput is greater then the latice spacing devided by the square root of 2, then set it to be N/2 1/2 and that used as the circle radius. Allow a circle size at a lattice point to be changed. A way to do this is, when a point is selected to draw a circle in the background color of radius N/2 1/2 before drawind the new circle with the newly imput radius.

I'm looking forward for your help and i would like to thank you in advance
Re: Need Help with writing one task
Reply #1 - Feb 9th, 2010, 12:02pm
 
I can see the solution he's trying to get at, but it's not how I'd do it.
I'd define a 2D array of floats that will be the radii of the circles at each point, update the array as needed, and just draw them every time without mucking about with trying to cover up old circles with other circles drawn in the background color.

I normally would write this up and post some code for you, but I've got places to be right now. I'll probably post some later though.  Smiley
Re: Need Help with writing one task
Reply #2 - Feb 9th, 2010, 1:28pm
 
Someone see's it at least haha, I can't say the same for me, It's just it would be far more easier to understand the whole deal if you can see it written and trace the steps in order to understand it.

Thanks for the fast answer, I'll try 'cook' the ideas myself in the meantime, but if it's not much trouble to post it I would be gratefull.

Have a nice evening for now Smiley
Re: Need Help with writing one task
Reply #3 - Feb 9th, 2010, 4:41pm
 
Lips Sealed
Student cheating on homework / assignment
Reply #4 - Feb 9th, 2010, 7:41pm
 
samsara43, this is a blatant attempt (perhaps successful in this case) to get someone to do your homework / assignment.

If you are indeed grateful enough for the answer/solution, please tell us what course you are studying so that we can report you to your teacher.

Failing that, I strongly recommend that you either write for yourself significantly different code or simply go to your teacher and say that you don't know what to do.

There is no point in pretending you can do it if you can't, unless you are not actually interested in learning how to do it and are only doing the class to satisfy some other person's interest.

TfGuy44, I'm supposing you also noticed the question sounds familiar - see: keyboard input, trying to input a two digit number. In that case Mattje presented a couple of efforts in solving (part) of the problem, including a working solution and further went on to correct an error in the code you posted.

I'm guessing that Mattje and samsara43 are in the same class, and samsara is simply not trying. Mattje's first post about it was a week ago.

One might hope that any teacher of a Processing class checks these forums for students cheating, but we should also not feed people answers when it is obvious that is what they are doing.

-spxl
Re: Need Help with writing one task
Reply #5 - Feb 10th, 2010, 6:59am
 
First of all  TfGuy44 Thanks for you efford and help. I'll run the program to see how its done and continue to extend/ or change it to suit my needs.


Secondly and I'm really sad that i have to pay that much of attention to subpixel. Where did you get all that spite, mate.

I'll gladly answer that i study Processing, but I'am distant learning student. So there is no teacher to report me to, or go to. If I had a teacher I would gladly ask him for help myself, but there is noone I can ask here, because there are no teachers or people that know the program, at least that i know of.

And I'am actually intrested in what I am doing, but to be able to do it I need to get a better understanding of the program which as I said in the begining i don't have "Im pretty new to Processing"

Now TfGuy44 gave me a possible solution on which I can work to see how its done and continue myself. If that was really my coursework I would be happy , but it isnt - It's just an intro to it Wink

And even if it is, I dont see how its your Job to spread justice in the world and how some people can be glad to help , while others just lack that piece of humanity in them
Re: Need Help with writing one task
Reply #6 - Feb 10th, 2010, 8:11am
 
Sorry - I'm going to back subpixel on this.  I see a lot of people asking for help without posting any code.  When they're offered a solution in code form they occasionally follow up with questions that indicate they have no understanding of the fundamental principles required to solve the problem and have made no effort to understand them - for example by working through the learning section.

If you want to ask a question that is clearly homework you need to demonstrate you've made some kind of effort.  In this case if, as you claim, you've understood the first part of the question then why not post the code that sets up the lattice  I'm afraid the impression you give is that you haven't even tried...

There are people on the forum all too happy to demonstrate they know how to implement a solution, but I'm not always convinced that's the best answer: IMO it's better to give guidance or code that demonstrates the principle rather than posting a direct solution to the problem...
Re: Need Help with writing one task
Reply #7 - Feb 10th, 2010, 9:42am
 
blindfish I understand what you're saying and at some point I can agree with you. I Haven't posted my efford simply because I'm kinda in a black zone with Processing atm. I only started learning the program a few weeks ago, thus im not sure what I'm writing. And thus i automatically assume my suggestions are totally wrong. As i saw the code posted I can tell i really was far away from the trace.

I am expected to deliver the coursework any day now and that is only a small part of it and i admit my knowledge on the subject is far away from the level it is expected to be. So in this situation I dont really have any choice or solution.

I don't want to take advantage of someone's help or get marks for something that isn't my own work. Thus i dont think I'll be able to complete my task.

There is noone that is able to help me out and go trought the task with, and I'm still learning with the help of textbooks and leaning section here, but it just aint enough for the current moment.

Tell me - what am i supposed to do in a situation where time is factor and my abilities need more time to develop?

Making a personal drama in a forum which ain't made for that. I'm sorry if someone can't see it in the way I do and is trying to accuse me of beeing a person I am not.

Greetings all and I'm out
Re: Need Help with writing one task
Reply #8 - Feb 10th, 2010, 3:01pm
 
That is unfortunate that you do not have a "teacher".

However, if the information from the course is not sufficient for you to understand the assignment, it is appropriate for you to contact whoever conducts the course to say so. If there was a level of assumed knowledge that you don't have, perhaps it is not the right course for you, and perhaps you can seek a refund.

I would advise if you are already in this far over your head that you are in trouble, and should really speak to the course administrator about it.

I am sorry if I upset you; I do believe that someone feeding you answers when you don't understand the basics is a recipe for continued problems, and will not ultimately be a good result for you.

As for spreading justice, it is every person's task to do so; if you do not uphold justice yourself, how can you expect to be treated justly? I would rather hope people complain about the spread of injustice.

I am a programmer, and it is in my interest to be interested in would-be programmers learning bad habits, or just not learning at all. The saying about a little bit of knowledge being dangerous is true for any complex endeavour, including programming.

I sympathise with you having a deadline and so on, but "the part where [you] get confused" is basically the entire problem, with several sub-problems, and you didn't give any clue as to what (in particular) you are confused about, which would lead any "help" to be "provide a complete solution" (and perhaps also explanation of the solution).

If you are having problems and have limited time, I suggest you start reading through the tutorials as soon as possible. Foundation learning is essential to your progress. Advancing beyond what you understand is really asking for stress and ultimately failure and disappointment.

-spxl

PS: If you don't think I am inclined to help people, search for other posts I have made on these forums. I honestly don't think someone giving you the answer is helping; directing you to more basic instruction appropriate to your skill level is the best help you can get without in-person instruction.
Re: Need Help with writing one task
Reply #9 - Feb 10th, 2010, 3:57pm
 

subpixel, now we understand eachother. Look i don't need to see your posts to know that you are helping people. It just felt like an attack to me so i had to answer back in that moment.

I understand where are you going and what you mean and i agree with it.
I dont want to start from the middle, because that wont lead me anywhere. I'm really intrested in working with Processing, just I kinda have to start from the middle just for that moment and that task I have.

Luckily what happened is that I got answer on my question, then i called a programmer friend, and by showing him the program and running it he was able to explain it step by step. So now I know what i am doing and i can continue myself. As soon as im finished with this project I'll be more then happy to go back to the basics and take it slowly - step by step again Wink

Page Index Toggle Pages: 1