none
qazwsxedc RRS feed

  • Question

  • Sub

    setattributes()

           

    Dimrng AsNewRandom


           

    Forlooper = 0 Tocards.Length - 1

                cards(looper).shooting = (rng.Next(1, 100) + 1)

                cards(looper).dribbling = (rng.Next(1, 10) + 1)

                cards(looper).heading = (rng.Next(1, 5) + 1)

                cards(looper).injury = (rng.Next(1, 10) + 1)

           

    Next


       

    EndSub


       

    Subdealhands(gamesize AsInteger)

           

    ReDimplayershand((gamesize / 2) - 1)

           

    ReDimcomputershand((gamesize / 2) - 1)

           

    Forlooper = 0 To(gamesize / 2) - 1

               

    Dimrandomnumber = Int(Rnd() * cards.Length)

                playershand(looper) = cards(randomnumber)

                removefromdeck(randomnumber)

     

                computershand(looper) = cards(randomnumber)

                removefromdeck(randomnumber)

     

           

    Next


       

    EndSub


       

    Subremovefromdeck(i AsInteger)

           

    Forlooper = i Tocards.Length - 2

                cards(looper) = cards(looper + 1)

           

    Next


           

    ReDimPreservecards(cards.Length - 2)

       

    EndSub


       

    Subtest()

           

    Forlooper = 0 Toplayershand.Length - 1

               

    Console.ForegroundColor = ConsoleColor.Cyan

               

    Console.WriteLine(playershand(looper).name)

               

    Console.ForegroundColor = ConsoleColor.Green

               

    Console.WriteLine(playershand(looper).dribbling)

               

    Console.WriteLine(playershand(looper).heading)

               

    Console.WriteLine(playershand(looper).shooting)

               

    Console.WriteLine(playershand(looper).injury)

           

    Next


           

    Console.ReadLine()

       

    EndSub


       

    Subshowtopcard()

           

    'Console.Clear()


           

    Console.ForegroundColor = ConsoleColor.Yellow

           

    Console.WriteLine("PLAYERS HAND")

           

    Console.ForegroundColor = ConsoleColor.Cyan

           

    Console.WriteLine("NAME:  "& playershand(0).name)

           

    Console.ForegroundColor = ConsoleColor.Red

           

    Console.WriteLine("================================================================================")

           

    Console.ForegroundColor = ConsoleColor.Green

           

    Console.WriteLine("heading:  "& playershand(0).heading)

           

    Console.WriteLine("shooting:  "& playershand(0).shooting)

           

    Console.WriteLine("Dribbling:  "& playershand(0).dribbling)

           

    Console.WriteLine("injury:  "& playershand(0).injury)

           

    Console.ForegroundColor = ConsoleColor.Red

           

    Console.WriteLine("================================================================================")

           

    ' Console.ReadLine()


       

    EndSub


       

    SubShowselectattributecOMPUTERS()

           

    'Console.Clear()


           

    Console.ForegroundColor = ConsoleColor.Yellow

           

    Console.WriteLine(UCase("computers") & " HAND")

           

    Console.ForegroundColor = ConsoleColor.Cyan

           

    Console.WriteLine("NAME:  "& computershand(0).name)

           

    Console.ForegroundColor = ConsoleColor.Red

           

    Console.WriteLine("================================================================================")

           

    Console.ForegroundColor = ConsoleColor.Green

           

    Console.WriteLine("heading:  "& computershand(0).heading)

           

    Console.WriteLine("shooting:  "& computershand(0).shooting)

           

    Console.WriteLine("Dribbling:  "& computershand(0).dribbling)

           

    Console.WriteLine("injury:  "& computershand(0).injury)

           

    Console.ForegroundColor = ConsoleColor.Red

           

    Console.WriteLine("================================================================================")

           

    ' Console.ReadLine()


       

    EndSub

    Monday, November 12, 2018 3:27 PM

All replies

  • Unless you modify

    1. Your title
    2. Place code into code blocks
    3. Write what you are looking for.

    I will be force to move your question to an off-topic forum.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, November 12, 2018 4:53 PM