Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can i create Long Multiplication in unity ?

Discussion in 'Scripting' started by BlackHacker, Aug 28, 2014.

  1. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
  2. parandham03

    parandham03

    Joined:
    May 2, 2012
    Posts:
    174
    can u explain what u exactly want to do.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Well, that page explains how long multiplication works. There's nothing there that's specific to Unity — you could implement this in C# on the command line, or in any other language for that matter. Use an array to hold the digits of each number, and just implement the algorithm as described.

    Or was your question about how to display this process in some interesting manner in Unity?
     
    BlackHacker likes this.
  4. Polymorphik

    Polymorphik

    Joined:
    Jul 25, 2014
    Posts:
    599
    This is basic recursion. If this is a thesis, I am assuming you are a math major or computer science major. This should be easy to develop in Unity3D especially since you want the product of what you are doing to be interactive. If you have no knowledge of programming, I suggest you figure something else out as it will be moderate to difficult for a beginner.
     
  5. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    yes my thesis is all about long method computation is this possible in unity ?

    @JoeStrout yes joe i want to display that process/idea in unity is it possible ? thanks a lot for helping
     
    Last edited: Sep 2, 2014
  6. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    @parandham03 is it possible to create long method multiplication in unity. ? can you give me a sample ? thanks for helping.
     
  7. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    -Yes joe i want to display that process in unity is it possible ? can i have a sample ? thanks for helping/
     
  8. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,355
    If you want to multiply numbers you can. Every single programming language out there can do addition, subtraction, multiplication and division.

    Code (JavaScript):
    1. var number;
    2.  
    3. function Start() {
    4. number = 5 * 6 * 7 * 8 * 9 * 10
    5. }
    If you want to multiply numbers you need *

    Are you planning to use Unity for games? : P
     
    BlackHacker likes this.
  9. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    It's certainly possible. I don't have a sample for you, but your question boils down to: how do you display text in Unity?

    There are several ways to do this... GUI.Label is perhaps the one I'm most familiar with. GUIText is another.
     
    BlackHacker likes this.
  10. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    do you know long multiplication ? can i have that sample program in any programming languages ? thanks for helping.
     
  11. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,355
    You may use the code I've written, however it won't display the multiplication process - only the result.

    In Unity, attach this to any GameObject:

    Code (JavaScript):
    1. var answer = 0;
    2.  
    3. function Start() {
    4. //This is where you do multiplication
    5. answer = 1 * 2 * 3 * 4 * 5 * 6;
    6. }
    7.  
    8. function OnGUI() {
    9.     GUI.Label(Rect(Screen.width/2, Screen.height/2, 200, 200), answer);
    10. }
    This should draw a text in the center of the screen showing the number 720.
     
    BlackHacker likes this.
  12. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    And BlackHacker, before you ask again, no, it's unlikely anyone here is going to actually write the long multiplication code for you. That's a fair amount of work, and it's your thesis, not ours.

    However, assuming this is OK with your advisor, you could certainly hire someone to do it — there is a large community of contract software engineers well versed in Unity. Make sure you have a realistic budget (a few $100 would probably do it for a simple long-multiplication demo), and then post a job offer in the Commercial: Job Offering forum.
     
    ThermalFusion likes this.
  13. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    Thanks a lot elmer and sorry for asking too many questions
     
    Last edited: Sep 8, 2014
    elmar1028 likes this.
  14. BlackHacker

    BlackHacker

    Joined:
    Aug 28, 2014
    Posts:
    7
    Thanks a lot joe if only i have that money maybe i can do what you said but i came to this forum because this is a free forum and maybe many experts help me but thank you for helping.