Results 1 to 4 of 4

Thread: College help

  1. #1
    Join Date
    Jul 2014

    Post College help

    Hello guys!
    So i need to do this two problems for the college and im really, REALLY lost, i need some kind of help , for the moment teacher let us use Dreamweaver, so here are the problems:
    1)Make a game that simulates the game "the one".
    Function of the game:
    Each turn, each player drops a dice several times and keep adding points until one of this two things happen: the player decides to stop dropping the dice and keeps the score achieved or dice hits 1 and the player loose his turn.
    The player that gets 50 points first wins.

    2)Make a program that simulates the game "guess the code".
    Function of the game:
    The program generates a code of four colours that the user must guess, for example: the code might be blue-green-blue-red, en each try the user will try to guess what is the composition and the position of the colours, for example if the code is red-red-green-blue and the user guess yellow-red-red-green the program must answer three right colours and one good position, the user have 10 attempts to win.
    Sorry for my bad english and thank you.

  2. #2
    Join Date
    Oct 2012
    I'm not sure if anyone is going to help you on this one before we can see some of the attempts you have made.

  3. #3
    Join Date
    Mar 2007
    Ok, will call it like I see it...

    Either you are looking for someone to code for you and this is not a homework project and I say that because both are a little too complex for a beginner or you are in class assing around and not paying attention.

    With "the one" game and the "code" game, I assisted with an answer to some partial code that was part both.

    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  4. #4
    Join Date
    Mar 2012
    I'm not going to do the exercise for you (I don't write much JS anyway) but I will help you get started on the first one.

    Firstly, as with any programming job, you need to analyse and document what functionality the program needs to have. You need this to be able to do the job, but it also acts as a design spec. which (in a real-life scenario) you would get agreed before you touched any code. That is unless you are given a detailed design spec. So what functionality is needed?

    1. The ability to generate pseudo-random integers in the range 1 to 6, all of which are equally likely to arise.


    a) I say "pseudo-random" because you require specialist hardware to generate true random numbers.

    b) The requirement that all the integers are equally likely is not as simple as it may seem. E.g. If you:

    - Generate a floating point number between 0 and, say, 0.999999.
    - Multiply it by 5.
    - Round it to the nearest integer (i.e. 0.499995 rounds to 0 and 0.500000 rounds to 1)
    - Add 1.

    You will generate integers between 1 and 6, but they will not be equally likely to arise. I'll let you work out why, and how to avoid it.

    2. The ability to record and display the cumulative scores for a specific number of players E.g. Upto 6.

    3. The ability to record the number of players, and, optionally, their IDs.

    4. The ability to record and display who is the current player.

    5. The ability to record and display the interim score of the current player during a turn.

    6. The ability to accept a play or terminate choice by the current player.

    a) If they chose to terminate:
    - Their cumulative score is updated to match the interim score.
    - The current player is incremented.

    b) If a 1 is thrown:
    - The interim score is discarded.
    - The current player is incremented.

    c) Otherwise the number thrown is added to the interim score.
    - If the interim score reaches 50, the current player is shown to be the winner. The game ends.
    - Otherwise the go continues.

    Now all you have to do is turn that logic into code!
    Last edited by jedaisoul; 07-13-2014 at 08:45 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.15259 seconds
  • Memory Usage 2,860KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates