Motoma's Profile User Rating: *****

Reputation: 452 Architect
Group:
Mentors
Active Posts:
798 (0.52 per day)
Joined:
08-June 10
Profile Views:
20,088
Last Active:
User is offline Mar 14 2014 01:09 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Hyundai
Dream Kudos:
150
Icon   Motoma doesn't always respond to posts, but when he does he gets +rep.

Posts I've Made

  1. In Topic: Feedback of Masters Thesis

    Posted 11 Mar 2014

    Sure, where is it?
  2. In Topic: Python 3.3.0 storing new random values

    Posted 23 Jan 2013

    Populate the random number variable before your while loop, and then set it again every time it is correctly guessed:

    random_number = get_random_number()
    
    while True:
        chosen_number = get_user_guess()
        if chosen_number == lucky_number:
            print "You win"
            random_number = get_random_number()
        else:
            print "Try again"
    
    
  3. In Topic: How to detect a cheat

    Posted 17 Oct 2012

    A set is a collection type that will only contain unique objects: you could therefore put each player's hand into a set, and if the set doesn't equal five cards, there is a duplicate:

    value = {'2': 1, '3': 2, '4': 3, '5': 4, '6': 5, '7': 6, '8': 7, '9': 8, '10': 9, 'J': 10, 'Q': 11, 'K': 12, 'A': 13}
    suit = {'Clubs': 1, 'Diamonds': 2, 'Spades': 3, 'Hearts': 4}
    
    # Using the hands above:
    player1 = [(2, 1), (13, 1), (2, 1), (7, 2), (8, 3)]
    player2 = [(13, 3), (13, 2), (12, 2), (11, 4), (10, 1)]
    
    if is_cheating_hand(player1):
        print("Player 1 is cheating")
    if is_cheating_hand(player2):
        print("Player 2 is cheating")
    
    def is_cheating_hand(hand):
        # If the hand with duplicates removed is not the same length
        # as the original hand, there was at least one duplicate card
        return len(set(hand)) != len(hand)
    
    

My Information

Member Title:
D.I.C Addict
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Full Name:
Christopher Gilbert
Years Programming:
12
Programming Languages:
Python, PHP, C++, C#, SQL, HTML, CSS

Contact Information

E-mail:
Private
Website URL:
Website URL  http://motoma.io
Jabber:
Jabber  motoma@gmail.com
Skype:
Skype  Motoma
LinkedIn:
http://linkedin.com/in/Motoma
Facebook:
http://facebook.com/Motoma
Twitter:
Motoma

Comments

Page 1 of 1
  1. Photo

    atraub Icon

    05 May 2012 - 18:10
    Hey dude, haven't seen you around in a while, hope everything is going well. You better not forget about DIC!
  2. Photo

    Motoma Icon

    07 Oct 2011 - 06:20
    Thanks, all of you!
  3. Photo

    numberwhun Icon

    06 Oct 2011 - 23:46
    Congratulations on winning the IRC contest. That's pretty awesome! :)
  4. Photo

    Simown Icon

    25 Sep 2011 - 03:33
    I only just noticed - congratulations on winning the IRC contest!
  5. Photo

    supercorey Icon

    22 Sep 2011 - 18:34
    Congrats on winning the IRC compo! BitGirl was great!
  6. Photo

    Vator Icon

    27 Jul 2011 - 17:09
    Hello!
Page 1 of 1