Find Jobs
Hire Freelancers

Dice Roller.

£20-250 GBP

En curso
Publicado hace más de 8 años

£20-250 GBP

Pagado a la entrega
Implement a dice game GUI program based on Java Swing and according to the game rules and the implementation details below: any classes from the standard Java API Libraries ([login to view URL]) but you may not use any other third party libraries or NetBeans libraries or IDE specific libraries. Do not use drag and drop tools to create the graphical user interface for any part of this coursework. All code should be manually written and no tool which generates code automatically should be used. These are the image that should be used for each die [login to view URL] The rules of the game A human player competes against the computer. Both players throw 5 dice at the same time. The score of each throw for each player is the sum of the numbers shown on the faces of the dice. The objective of the game is to reach a score of 101 or more (instead of 101 another target can be set by the human before play starts) by throwing 5 dice as many times as necessary. After a roll, each player may either score it or take up to two optional rerolls. For each reroll, he may reroll all of the dice or select any of the dice to keep and only reroll the remainder. He may score at any time, thus ending his current throw; after the second reroll (three rolls total) he must score it. After both players score their rolls, the procedure is repeated until one of the players reach 101 or more points by summing all of their scores. If both players reach 101 or more with the same number of attempts (a single attempt is considered as one roll followed by 2 optional rerolls) the player with the highest score wins. As an example, assume that the human player scores 30 points in the first attempt (a roll followed by 2 optional rerolls), 25 in the second, 11 in the third, 28 in the fourth and 15 in the fifth achieving a total score of 109 in five attempts. If the computer did not score 101 in four attempts or more than 109 in five attempts, the human wins. In the case that both the computer and the human achieved the same score in the five attempts (i.e. 109 in the example), each player throws for a last time all five dice and the player with the highest sum in that roll wins (no optional rerolls are allowed in this case). In the case of a tie again, both players keep rethrowing all five dice until one of them wins. Specification Any graphical components in your GUI application should use relative positioning and NOT absolute positioning. I.e. when you resize the application (the window or frame of your applica- tion) each component will still be in the same “relative” position to other graphical components. You should NOT use coordinates x, y to specify that a component will be located at that specific point x, y in a container (absolute positioning). You should NOT disable the resizing of the main frame of the application. The details for the implementation of the system are given in the steps below: Create a Java interface DieIntf which contains four methods: getDieImage() (returning an ImageIcon), setImage (which sets the image associated with the face of a die for a die class implementing the interface), setValue(int v) which sets the value of the face of a die (which number is displayed on the top of a die) and getValue() (which returns the value of the face of a die, i.e. which number is displayed on the top of a die). CreateaclassDiewhichrepresentsadieandimplementstheDieIntfandtheComparable (found in the standard API package [login to view URL]) interfaces. For the implementation of the latter, a die with a higher face value is considered as “greater” than a die with a smaller face value. In terms of natural ordering, a die with higher value is coming after a die with a lower value. Design and implement a class Dice which contains 6 instances of Die objects each one of them having a different face (i.e. each one of them represents a die which displays on the top 1, 2, 3, 4, 5 and 6 respectively). The class should include a method roll() which returns an array of 5 objects (different ones every time the method is called), representing the roll of 5 dice. Each of these 5 returned objects should be selected from one of the 6 instances of Die objects created above, inside the class Dice. However, not all of them should be unique, as one roll of 5 dice may result in 6, 1, 4, 4, 2, i.e. the same object representing 4 on the face of a die must be included twice in the array. The class may contain any additional methods that you choose as appropriate and neces- sary for the rest of your game application. For the remaining subquestions, you should be using the classes Die and Dice that you implemented above. The implementation of your graphical application should include a button Throw. Each time it is pressed a simulation of throwing 5 dice by both the human player and the computer is performed simultaneously: The images of the five dice rolled by the human player and the five dice rolled by the computer are displayed. The human player may choose to score by pressing a button Score or take up to two optional rerolls (see below). As soon as the player clicks on Score the total score for the current game should be updated for both the human player and the computer player. If the user performs the maximum of 3 rolls for that turn, the score is updated automatically without the need to press the Score button (see the rules of the games described above). For each of the 2 optional rerolls, the human player should be able to select (it is left up to you to design the appropriate user interface for this) which dice (if any) he would like to keep for that roll. After selecting this, he should press the Throw button again and the dice which have not been selected for keeping should be rerolled. The computer player follows a random strategy. I.e. first it decides randomly whether it would like to reroll (up to a maximum of 3 rolls per time) and if this is the case it decides randomly which dice to keep. A single reroll for the computer player occurs and it is displayed only after the human player clicks on the Throw button. If the human player clicks on the Score button, the computer player uses all of its remaining rolls for that turn according to the random strategy, i.e. the final result of the five dice is displayed after the computer has used (optionally based on the random strategy) the 2 rerolls (for a total maximum of 3 rolls). Modify your implementation above so that when the user presses the Throw button, the rolls of the human player and the computer player are performed by 2 separate threads (different than the main thread and the event dispatch thread) and the results are displayed as above in the main graphical area of your application When a player (human or computer) reaches 101 or more points a pop up window with the message “You win!” is displayed (if the human wins) or “You lose” (if the computer wins). You should implement the exact rules of the game described in the Section “The rules of the game” above. Implement what happens in the case of a tie according to the exact rules of the game described in the Section “The rules of the game” above (the 2 players keep rolling until the tie is broken - no rerolls in this case). Implement a button New Game which reinitializes the application and starts a new game. Extend your implementation by allowing the human player to set the number of points which is the target to reach for the winning player (default value is 101). The number of wins and losses should be saved in a file every time the application exits. When the application starts, the number of wins and losses for the human player and the computer should be read from the file above and displayed in the main graphical area of the application for the whole duration of a game. Design and implement an efficient (as optimum as possible) strategy for the computer player strategy. The strategy you design should determine whether the computer player should reroll some of its dice and which ones (up to a maximum of 2 rerolls - total maximum of rolls is 3). You should assume that the computer player cannot see the current dice of the human player displayed in the application, but it is aware of (i.e. it can see) the current total of the current game for both itself and the human player, i.e. the computer player knows that the score of the current game is, e.g. 79 − 93.
ID del proyecto: 9103146

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hello My name is Ahmed, i passed freelancer java exam with top 10% rated plus i got 2 java certificate 1Z0-803 and 1Z0-804 with 3+ years experience. small overview of feedback on my profile “professional , the best , if u have any problem, i would recommend Ahmed” "Highly recommended , smart , on time ,high experience and he did a difficult assignment that others couldn't finish . will hire again" “Awesome job as usual highly recommended very dedicated and satisfying A+++ Thank you for this great job” looking forward to work with you Regards
£35 GBP en 1 día
4,9 (103 comentarios)
5,2
5,2
16 freelancers están ofertando un promedio de £216 GBP por este trabajo
Avatar del usuario
I am TOP RANKED Java programmer. I have read the details and I can develop this Dice Roller game if awarded. Thanks
£157 GBP en 3 días
4,9 (398 comentarios)
7,2
7,2
Avatar del usuario
Hello I am Java expert and interested in this project. I have reviewed your requirements and confident to handle this project perfectly. I also have a lot of experience inhelping students with assignments. Please communicate to discuss further. Regards Anshu
£200 GBP en 3 días
4,7 (324 comentarios)
7,2
7,2
Avatar del usuario
hi mate this is Asad, i have a lot of experience in java programming, need an A grade in this task?contact me right now,cheers :)
£155 GBP en 3 días
4,8 (48 comentarios)
5,7
5,7
Avatar del usuario
Hi, I am interested in your project. I have required skills and experience in Java development including making 2d games. I have completed several projects on this freelancer site and on others resources. All of them were successful. You can check out my portfolio and projects feedback if you like. I am able to complete your task fast and with good quality. Fill free to contact me so we can discuss any details. Thank you for your consideration. Vitalii Oleksiv
£150 GBP en 5 días
4,9 (36 comentarios)
5,5
5,5
Avatar del usuario
Hello Thanks for your good project. I have checked your job description carefully and I am sure that I can complete this job perfectly. As you know from my profile, i have full skill and ability for this job. Please check my work history. https://www.freelancer.com/u/wancheng.html I’m the best mobile app developer who are very familiar with android and iOS My ultimate goal is to build a long lasting relationship with my clients. I am looking forward to hear something positive from you and working on this project. If you hire me, you will get more benefits than you expected from the other freelancers. I'm ready to start your work and we can discuss your requirements via Voice conversation. please send me a private message to discuss details. Thanks.
£1.578 GBP en 20 días
5,0 (4 comentarios)
5,4
5,4
Avatar del usuario
Note: I have done the similar work which you need. 10 Years of Experience with best start ups in Java & J2EE technologies, want to do the things right at first hand. Looking to work independently and to learn through new challenges. Will deliver the best, working as an Architect. Would be glad to hear from you, once you share your project requirement, will provide you the detailed design and implementation plan. I am always ready to respond without any delay and work in real time manner. We can discuss more, my skype id is softwaredesigner01
£200 GBP en 15 días
4,9 (16 comentarios)
4,5
4,5
Avatar del usuario
Expert team here, We have developed number of tasks like this before. You can see our portfolio. Lets discuss price and timeline etc.
£150 GBP en 3 días
4,4 (39 comentarios)
4,9
4,9
Avatar del usuario
Aucune proposition n'a encore été fournie.
£245 GBP en 3 días
4,9 (14 comentarios)
4,2
4,2
Avatar del usuario
Hi, I have 5 years of experience in Java Swing. Hope we can have a conversation. I can do this work in 3 dasys Regards, Nagaraja G
£133 GBP en 3 días
4,5 (5 comentarios)
3,4
3,4
Avatar del usuario
Hi I have this game ready for you if you want i can deliver deliver it now. I’m a Software Engineer having much knowledge in programming languages like java C++ Php Java Script CSS HTML etc. Data scraping Data mining Data Manipulation Extracting Data from websites I also have a team for this so you don't worry about third party client. I assure you that I’ll do my best to do this project. My team is also very experienced and talented. The project bid is negotiable and P.M for sample work . Thanks
£28 GBP en 1 día
5,0 (2 comentarios)
2,2
2,2
Avatar del usuario
Hi, I am professional in this task.I would like to assist you in your projects. Get it done professionally get it done right the 1st time. I am here to make long term relationship. I would like to get all details from you and ready to start ASAP . Lets discuss.
£277 GBP en 7 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Dear You, I am really interested to work on this project, I can start the work now , and can provide the best services from my end. Please come on chat to discuss more about the project. Thanks!
£222 GBP en 3 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hello sir. I am expert java developer. I have made similar game and many other games. I will give you genuine code withing my estimate time. I write professional code and deliver work in time. Please discus details with me Regards Usman Shery
£44 GBP en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I implemented Yahtzee game in c# as a Windows Form Application, witch is very similar to your game. I have working experience only with JavaFX not with Swing, but I could do it in Swing too (a little more time). Your instructions are very clear and I'm sure I can do the project but I'm new at the site with not much experience that's why I want to make this project for relatively little money.
£50 GBP en 5 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED KINGDOM
London, United Kingdom
4,8
4
Forma de pago verificada
Miembro desde dic 11, 2015

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.