yay last min uni work part 2.... I need help

Johanson said:
Well if asking for a bit of maths help is 'cheating ', this thread must be worth a jail sentence at least.
Your signature is perdy..... But less of the distractions, I would hardly class your thread as cheating and I need to figure a way to randomly place treasures :D
 
Well his university may have rules against showing code to other people. For instance, someone on your course may stumble accross this thread and steal your code.
 
Chrisss said:
Well his university may have rules against showing code to other people. For instance, someone on your course may stumble accross this thread and steal your code.
Good point, dident think of that, Removed all my code and hope no one has coppied or im royaly.....
 
Phnom_Penh said:
So have I lol.


@ jcb33,

you can start the game again by calling the game's method, like game.play(); or whatever. To terminate the program, use System.exit(1);.

I think he mentioned that he has to use procedural (non-OO) code though, so wouldn't having methods (aside from the Main method) make it OO?

Seems a bit silly though as OO would make it easier in the long run :confused:
 
jcb33 said:
Good point, dident think of that, Removed all my code and hope no one has coppied or im royaly.....

Well if you need help with a specific bit of code then that's probably fine, but posting whole methods...probably not.
 
Phil99 said:
I think he mentioned that he has to use procedural (non-OO) code though, so wouldn't having methods (aside from the Main method) make it OO?

Of course not, procedural code has methods/functions as well. You just don't invoke them on an object.
 
Im trying to get the treasure to place randomly using Math.Random but so far All I can manage is to cover the grid with Rings not just place one

Code:
                    {            {
                int x=(int)(Math.random()*7+1), y=(int)(Math.random()*8+1);
                         
               if(grid1[x][y] == 0)
               {             
            grid1[x][y] = ring;
        }
        else if(grid1[x][y]>0)
        {        
          grid1[x][y] = ring;
          }
          
                         
            if(grid1[x][y] == 0)
            {
                grid1[x][y] = ring;
            }
           
            if(grid1[x][y] == 0)
            {
            grid1[x][y] = sword;
            grid1[x][y] = sword;
            grid1[x][y] = sword;
        }
        
         else if(grid1[x][y]>0)
            {
            grid1[x][y] = sword;
            grid1[x][y] = sword;
            grid1[x][y] = sword;
        }
        
         if(grid1[x][y] == 0)
            {
            grid1[x][y] = sword;
            grid1[x][y] = sword;
            grid1[x][y] = sword;
        }
         else if(grid1[x][y]>0)
            {
            grid1[x][y] = sword;
            grid1[x][y] = sword;
            grid1[x][y] = sword;
        }
            
           if(grid1[x][y] == 0)
           {
            grid1[x][y] = statue;
        }
        else if(grid1[x][y]>0)
    {
            grid1[x][y] = statue;
        }
            if(grid1[x][y] == 0)
            {
            grid1[x][y] = chest;
            grid1[x][y] = chest;
            grid1[x][y] = chest;
            grid1[x][y] = chest;
                
        }

Im trying to get it so it only places 7 of the 10 avaliable pieces at any one time, and so that it randomises their location each time
 
Last edited:
Is that in some sort of loop? I ask because x and y will only change when you call the random function again, not each time that you reference them.

Why are you testing for the same things repeatedly?

You seem to be trying to set lots of things to happen if grid[x][y]==0 for example, surely 0 would only represent a specific case, eg 0 means a sword?.
 
Look at the code I posted above ^.

Basically within a method have a loop. Now within that loop define x and y to be random numbers. So whenever it goes through the loop (says say twice) it x and y will change. For example:

Code:
    public void randomiseItems()	
    {  		
    	for(int x = 0; x < 6; x++)
    	{
    		int xv = random.nextInt(6)+1;
    		int yv = random.nextInt(7)+1;
    		
    		if(board[xv][yv].equals ("[ ]"))
    		{
      				board[xv][yv] = "[T]";
    		}	
    	}
    }

So if there is already something in that particular block you can go: ELSE x--;
 
Phil99 said:
I think he mentioned that he has to use procedural (non-OO) code though, so wouldn't having methods (aside from the Main method) make it OO?

Seems a bit silly though as OO would make it easier in the long run :confused:
I wouldn't say that using a while loop to run a method was oo. If he was creating objects, then calling the methods in them, then yes, but otherwise I wouldn't have thought so.

But yes, oo would make it easier.
 
jcb33 said:
Would you actualy get in trouble for having the work you have done posted by you on the net?
I don't know... the operative part of that sentence being "Work YOU have done".

True, but maybe programming isn't his desired outcome of his degree, and he just needs to pass this module?

It really really REALLY narks me off that people can just swan through uni like this. I worked hard at my degree, and whilst certain areas were not my area of expertise or whatever you want to call it, I still did 100% my own work and put in the hours to learn how to actually do something myself without being drip- fed huge chunks of code. If he is not good enough to do it, he should fail, and if he fails his degree, too bad.
 
Bes said:
I don't know... the operative part of that sentence being "Work YOU have done".



It really really REALLY narks me off that people can just swan through uni like this. I worked hard at my degree, and whilst certain areas were not my area of expertise or whatever you want to call it, I still did 100% my own work and put in the hours to learn how to actually do something myself without being drip- fed huge chunks of code. If he is not good enough to do it, he should fail, and if he fails his degree, too bad.

Absolutely agree with you, there's a guy on my course who sponges coding from everyone and it does my nut in. I've learnt to keep my code to myself. He doesnt want to learn he just wants to get the answer straight away, I cant see the point in coming if your gonna do that.

+44
 
Plus-44 said:
Absolutely agree with you, there's a guy on my course who sponges coding from everyone and it does my nut in. I've learnt to keep my code to myself. He doesnt want to learn he just wants to get the answer straight away, I cant see the point in coming if your gonna do that.

+44
That's pretty much what ive said since the start of this thread....

Answers to any of the questions made by JCB in this thread could be answered by using a book, googling for tutorials, or actually turning up to lectures/tutorials?
 
Welshy said:
That's pretty much what ive said since the start of this thread....

Answers to any of the questions made by JCB in this thread could be answered by using a book, googling for tutorials, or actually turning up to lectures/tutorials?
Aye most of the time these mickey mouse unis practically give you the solution to the assignment over the course of the semester.
 
Plus-44 said:
Absolutely agree with you, there's a guy on my course who sponges coding from everyone and it does my nut in. I've learnt to keep my code to myself. He doesnt want to learn he just wants to get the answer straight away, I cant see the point in coming if your gonna do that.

+44
Ah but I want to learn, I just dident realise that you need to be 10 steps ahead of what your being taught so dident know how to do.. well much over helloworld. I have learnt a lot from doing this, and I havent been drip fed everything, I fully admit that I got a lot of help, but even so, anything I was given I refused to copy, I learnt how it worked, and why it worked, and then wrote up my own version and kept playing untill I got it working.

I do not plan on sponging off anyone for my course, nor have I in any of my other assignments, but with this I realy did need help.

And as soon as I get some free time Im going to get myself some Programing for dummies books and make sure I do a little each day untill I feel I am compitant.

I also found it quite fun, while very frustrating trying to solve my own problens for example with the if statement earlier I had a ; in the wrong place and it would not work and I was staring at thoes lines for hours but I wont forget how to do an if statement in a hurry and I was able to solve other problems thanks to this.

So While I do See where you are coming from, and I acknowlege I got to much help with this I would prefer you did not stereotype me as someone who is going to plagerise everyone elses work while I am at uni. I have worked hard to get here, gone through many problems that you will never know about but managed to come out the other end and pull myself up and into uni. I am going to get my degree because I am determined not to fail, I will learn as much as I can (Now I realised how much I actualy need to know :p ) and prety much thats all I have to say....

Now onto my next assignment.... *Wonders off into the distance singing*
 
Last edited:
Welshy said:
That's pretty much what ive said since the start of this thread....

Answers to any of the questions made by JCB in this thread could be answered by using a book, googling for tutorials, or actually turning up to lectures/tutorials?
I will also note I have not missed a single lecture, workshop or other since I started uni
 
jcb33 said:
Ah but I want to learn, I just dident realise that you need to be 10 steps ahead of what your being taught so dident know how to do.. well much over helloworld.
Oh so you didn't realise University required you to be able to work independently and direct your own learning?

And I hope you don't mind me advising you that your spelling and grammar are appalling for someone who is aiming for a degree? I really hope you brush it up for your CV and covering letter, as no employer in their right mind would take you and your potentially ill-gotten degree on board with a CV riddled with spelling errors.
 
Bes said:
Oh so you didn't realise University required you to be able to work independently and direct your own learning?

And I hope you don't mind me advising you that your spelling and grammar are appalling for someone who is aiming for a degree? I really hope you brush it up for your CV and covering letter, as no employer in their right mind would take you and your potentially ill-gotten degree on board with a CV riddled with spelling errors.

Now now, no need for sarcasm, I did realise that yes, but I did not realise how far ahead the assignment would be compared to what we have been taught.

Also I know my spelling is bad, but then again being dyslexic does not realy aid that. I make certain that anything important is done well, and I have been employed in the past without problems (Still am).

I would also comment that my degree will not be "Ill Gotten" but earned via the use of hard work which I intend to be putting in for the next 2 and a half years.

I would also like to ask you to stop commenting on this thread and find someone else to insult, but if you wish to continue I will simply ignore it.

Dons please remove this thread now, I think its about done.... *Dons flame retardent suit and walks off*
 
Back
Top Bottom