battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.


battle programming a forum for elite programmers with extreme will power to sharpen their skills
 
HomeGallerySearchRegisterLog in
 

 update auxilary class : DiSkillUtils

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 511
Join date : 2011-08-02

update auxilary class : DiSkillUtils Empty
PostSubject: update auxilary class : DiSkillUtils   update auxilary class : DiSkillUtils EmptyWed Mar 10, 2021 12:23 am

Code:
import java.util.ArrayList;

public class DISkillUtils {
   public Algorithm verbatimGorithm(AbsAlgPart itte) {
      // returns a simple algorithm containing 1 alg part
      String representation = "util";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("util", representation, algParts1);
      return algorithm;
   }

   public Algorithm verbatimGorithm(String algMarker, AbsAlgPart itte) {
      // returns a simple algorithm for saying sent parameter
      String representation = "util";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("util", representation, algParts1);
      return algorithm;
   }

   public Algorithm customizedVerbatimGorithm(String algMarker, AbsAlgPart itte) {
      // the most stable and advanced algorithm builder
      // returns a simple algorithm containing 1 alg part
      String representation = "r_" + algMarker;
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm(algMarker, representation, algParts1);
      return algorithm;
   }

   public Algorithm customizedVerbatimGorithm(String algMarker, AbsAlgPart... itte) {
      // the most stable and advanced algorithm builder
      // returns a simple algorithm containing 1 alg part
      String representation = "r_" + algMarker;
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      for (int i = 0; i < itte.length; i++) {
         algParts1.add(itte[i]);
      }
      Algorithm algorithm = new Algorithm(algMarker, representation, algParts1);
      return algorithm;
   }
}

a function has been added to make it much faster and easier to form algorithms out of algorithm parts

_________________
MB over and out emp it up
Back to top Go down
 
update auxilary class : DiSkillUtils
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: the LivinGrimoire-
Jump to: