Ice cream for Everyone's Open Source Ice cream


Version002


//!-- description:"ice_cream_for_everyone/open_source_ice/ice_cream_generator/190600/version01/" 
generated:19/06/00 by Simon Pope & Mark Greco 
ammended: 20/06/00 by Colin Green, 
version: 002
extends version:
_____________________________________
licence:  
ice_cream generator 
Copyright (C) 2000  Ice Cream for Everyone 
 
 This program is free; you can redistribute it and/or 
modify it under the terms of the GNU General Public License 
as published by the Free Software Foundation; either version 2 
of the License, or (at your option) any later version. 
 
This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
GNU General Public License for more details. 
 
GNU General Public License is available from the Free Software 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
http://www.gnu.org/copyleft/gpl.html  
Contact 'Ice cream for Everyone' mark.greco@virgin.net 
http://bak.spc.org/ice 
_____________________________________

//use Backus-Naur Form for units: see 
http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?Backus-Naur+Form usually see 
it in specifications.

//make it a bit more object-oriented, classes read more like recipies than 
procedural stuff. Here's a bit of javaish

// class names start with capitals, constants are all caps

class Icecream {

	// static initial ingredients

	Spatula spatula = new Spatula(PLASTIC);
	Bowl bowl		= new Bowl(SMALL, SHALLOW);
	... etc THIS NEEDS WRITING. any offers?

	Emulsifier emulsifier;
	Custard custard;
	Liquid milk;
	Fat butter;
	Flavour	vanilla;


	// then you need some inner classes to do some preparation

	class Emulsifier {
		// a constructor method
		Emulsifier(Bowl bowl) {
			Cornflour c = Cornflour.getTeaspoon(Teaspoon.random(1, 3));
			Sugar s		= Sugar.getTeaspoon(Teaspoon.random(2, 6));
			Spoon sp	= new Spoon(METAL);
			
			bowl.add(c);
			bowl.add(s);
			while (bowl.getContents().isLumpy()) {
				sp.mix(bowl);
			}
			bowl.add(this.milk);
			while (!bowl.getContents().isPaste()) {
				sp.mix(bowl);
			}
		}
	}

	// etc... THIS NEEDS WRITING. any offers?

	
	// main Icecream constructor
	
	public Icecream() {
		
		milk		= new Milk.getPints(FULL_FAT, 2);
		butter		= new Butter.getOunce(Ounce.random(2, 4));
		vanilla		= new Vanilla().split(RANDOM);

		emulsifier 	= new Emulsifier();
		custard		= new Custard();

	}



	private simmer(Time t) {
		while (time < t) {
			if (!bowl.getContents().isBoiling()) {
				heat(bowl);
			}
		}
	}


	public make() {
		Freezerbowl f = new Freezerbowl();
		f.freeze();
		custard.simmer(10);
		custard.setVanilla(false);
		while (!custard.isFrozen()) {
			freezerbowl.mix(spatula);
		}
	}

}



anyway to make some icecream do new Icecream().make() thats it, well theres 
some methods left to implement but I'll leave that up to you. And its 
bollocks java too.

Mail changes to 'ice cream for everyone': mark.greco@virgin.net

http://bak.spc.org/ice

http://bak.spc.org