Delphi combinatorics app

I have created a component that is useful in math for Combinatorics! If you don’t know about them you can loot at here for more information about; below you can see a video of the component in action! I made this:

This is the relevant code:

uses
 System.Math, System.SysUtils, Combinatorio, System.Classes;

type

 TCombinazioni = class(TInterfacedObject, ICombinatorio)
  private
   n, k: integer;
   ripetizione: boolean;
   function fattoriale(const x: integer): integer;
  public
   constructor Create(const n, k: integer; const ripetizione: boolean);
   function getSoluzioni(): integer;
   function getFormula(): string;
 end;

 TDisposizioni = class(TInterfacedObject, ICombinatorio)
  private
   n, k: integer;
   ripetizione: boolean;
   function fattoriale(const x: integer): integer;
  public
   constructor Create(const n, k: integer; const ripetizione: boolean);
   function getSoluzioni(): integer;
   function getFormula(): string;
 end;

 TPermutazioni = class(TInterfacedObject, ICombinatorio)
  private
   n: integer;
   k: string;
   ripetizione: boolean;
   function fattoriale(const x: integer): integer;
  public
   constructor Create(const n: integer; const k: string; ripetizione: boolean);
   function getSoluzioni(): integer;
   function getFormula(): string;
 end;

They implement interfaces so they are reference counted and you don’t need to call the Free! Very cool isn’t it? The main interface in particular is the following:

unit Combinatorio;

interface

type
 ICombinatorio = interface
  function getSoluzioni(): integer;
  function getFormula(): string;
 end;

implementation

end.

If you want to have the entire source code or the component, just leave a comment in the video! Happy coding!

24 risposte a “Delphi combinatorics app”

  1. It’s perfect time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you some interesting things or advice. Maybe you can write next articles referring to this article. I wish to read even more things about it!

  2. Hi, i feel that i saw you visited my web site so i came to go back the prefer?.I’m attempting to in finding
    issues to enhance my website!I guess its good enough to use some of your
    ideas!!

  3. I’ve been exploring for a little for any high-quality articles or blog posts on this sort of house . Exploring in Yahoo I finally stumbled upon this site. Studying this information So i’m satisfied to show that I have a very good uncanny feeling I found out just what I needed. I such a lot undoubtedly will make certain to do not omit this site and provides it a look on a relentless basis.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato.