class
MAINCLASS
inherit
ARGUMENTS
create
make
feature
file_name: STRING_8 = "E:\EiffelData\MyList.txt"
make
local
line : STRING
call : AUTOMAT_NEW
call2 : ADD
do
io.read_line
line := io.last_string
create call.make_automate (line)
call.bbb
--print(call.get_group) print(" ") print(call.get_value)
create call2.make_add (call.get_group, call.get_value)
call2.store_by_name (file_name)
call2 ?= call2.retrieve_by_name (file_name)
end
end
Thursday, December 23, 2010
Monday, December 20, 2010
My Java sourse code
/** linked binary trees */
package dataStructures;
import java.lang.reflect.*;
public class LinkedBinaryTree implements BinaryTree {
// instance data member
BinaryTreeNode root; // root node
// class data members
static Method visit; // visit method to use during a traversal
static Object[] visitArgs = new Object[1];
// parameters of visit method
static int count; // counter
static Class[] paramType = { BinaryTreeNode.class };
// type of parameter for visit
static Method theAdd1; // method to increment count by 1
static Method theOutput; // method to output node element
// method to initialize class data members
static {
try {
Class lbt = LinkedBinaryTree.class;
theAdd1 = lbt.getMethod("add1", paramType);
theOutput = lbt.getMethod("output", paramType);
} catch (Exception e) {
}
// exception not possible
}
// only default constructor available
// class methods
/** visit method that outputs element */
public static void output(BinaryTreeNode t) {
System.out.print(t.element + " ");
}
/** visit method to count nodes */
public static void add1(BinaryTreeNode t) {
count++;
}
// instance methods
/** @return true iff tree is empty */
public boolean isEmpty() {
return root == null;
}
/**
* @return root element if tree is not empty
* @return null if tree is empty
*/
public Object root() {
return (root == null) ? null : root.element;
}
/**
* set this to the tree with the given root and subtrees CAUTION: does not
* clone left and right
*/
public void makeTree(Object root, Object left, Object right) {
this.root = new BinaryTreeNode(root, ((LinkedBinaryTree) left).root,
((LinkedBinaryTree) right).root);
}
/**
* remove the left subtree
*
* @throws IllegalArgumentException
* when tree is empty
* @return removed subtree
*/
public BinaryTree removeLeftSubtree() {
if (root == null)
throw new IllegalArgumentException("tree is empty");
// detach left subtree and save in leftSubtree
LinkedBinaryTree leftSubtree = new LinkedBinaryTree();
leftSubtree.root = root.leftChild;
root.leftChild = null;
return (BinaryTree) leftSubtree;
}
/**
* remove the right subtree
*
* @throws IllegalArgumentException
* when tree is empty
* @return removed subtree
*/
public BinaryTree removeRightSubtree() {
if (root == null)
throw new IllegalArgumentException("tree is empty");
// detach right subtree and save in rightSubtree
LinkedBinaryTree rightSubtree = new LinkedBinaryTree();
rightSubtree.root = root.rightChild;
root.rightChild = null;
return (BinaryTree) rightSubtree;
}
/** preorder traversal */
public void preOrder(Method visit) {
this.visit = visit;
thePreOrder(root);
}
/** actual preorder traversal method */
static void thePreOrder(BinaryTreeNode t) {
if (t != null) {
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
thePreOrder(t.leftChild); // do left subtree
thePreOrder(t.rightChild); // do right subtree
}
}
/** inorder traversal */
public void inOrder(Method visit) {
this.visit = visit;
theInOrder(root);
}
/** actual inorder traversal method */
static void theInOrder(BinaryTreeNode t) {
if (t != null) {
theInOrder(t.leftChild); // do left subtree
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
theInOrder(t.rightChild); // do right subtree
}
}
/** postorder traversal */
public void postOrder(Method visit) {
this.visit = visit;
thePostOrder(root);
}
/** actual postorder traversal method */
static void thePostOrder(BinaryTreeNode t) {
if (t != null) {
thePostOrder(t.leftChild); // do left subtree
thePostOrder(t.rightChild); // do right subtree
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
}
}
/** level order traversal */
public void levelOrder(Method visit) {
ArrayQueue q = new ArrayQueue();
BinaryTreeNode t = root;
while (t != null) {
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
// put t's children on queue
if (t.leftChild != null)
q.put(t.leftChild);
if (t.rightChild != null)
q.put(t.rightChild);
// get next node to visit
t = (BinaryTreeNode) q.remove();
}
}
/** output elements in preorder */
public void preOrderOutput() {
preOrder(theOutput);
}
/** output elements in inorder */
public void inOrderOutput() {
inOrder(theOutput);
}
/** output elements in postorder */
public void postOrderOutput() {
postOrder(theOutput);
}
/** output elements in level order */
public void levelOrderOutput() {
levelOrder(theOutput);
}
/** count number of nodes in tree */
public int size() {
count = 0;
preOrder(theAdd1);
return count;
}
/** @return tree height */
public int height() {
return theHeight(root);
}
/** @return height of subtree rooted at t */
static int theHeight(BinaryTreeNode t) {
if (t == null)
return 0;
int hl = theHeight(t.leftChild); // height of left subtree
int hr = theHeight(t.rightChild); // height of right subtree
if (hl > hr)
return ++hl;
else
return ++hr;
}
/*******************MyLinkedBinaryTree*******************/
public Object clone() {
LinkedBinaryTree cloneObject = new LinkedBinaryTree();
cloneObject.root = Clone(root);
return cloneObject;
}
static BinaryTreeNode Clone(BinaryTreeNode a)
{
if (a == null)
return null;
else {
BinaryTreeNode b = new BinaryTreeNode(a.element);
b.leftChild = Clone(a.leftChild); //
b.rightChild = Clone(a.rightChild);
return b;
}
}
public void swapSubTrees(BinaryTreeNode node)
{
if (node != null)
{
// do the sub-trees
swapSubTrees(node.leftChild);
swapSubTrees(node.rightChild);
// baruun zuun zangilaanii bairiig solih
BinaryTreeNode temp = node.leftChild;
node.leftChild = node.rightChild;
node.rightChild = temp;
}
}
public void swapSubTrees() {
swapSubTrees(root);
inOrder(theOutput); //inOrder nevtrelteer hevlene
}
public MyChain toList() {
MyChain r = new MyChain();
treeToList(root, r);
//swapsubTrees()
return r;
}
private void treeToList(BinaryTreeNode node, MyChain goal) {
if (node != null)
{
treeToList(node.leftChild,goal);
int k = 0;
goal.add(k++, node.element);
treeToList(node.rightChild, goal);
}
}
BinaryTreeNode tree;
public void tree()
{tree = root;}
static int max = 0;
public void max() {
BinaryTreeNode node = tree;
if (max < Integer.parseInt(node.element.toString()))
{
max = Integer.parseInt(node.element.toString());
}
if (node.leftChild == null && node.rightChild == null)
;
else {
if (node.leftChild != null) {
tree = node.leftChild;
max();
} else {
if (node.rightChild == null) {
tree = node.rightChild;
max();
}
}
}
}
static int min = 100;
public void min() {
BinaryTreeNode node = tree;
if (min > Integer.parseInt(node.element.toString())) {
min = Integer.parseInt(node.element.toString());
}
if (node.leftChild == null && node.rightChild == null)
;
else
{
if (node.leftChild != null) {
tree = node.leftChild;
min();
} else
{
if (node.rightChild == null) {
tree = node.rightChild;
min();
}
}
}
}
/** test program */
public static void main(String[] args) {
LinkedBinaryTree a = new LinkedBinaryTree(),
x = new LinkedBinaryTree(),
y = new LinkedBinaryTree(),
z = new LinkedBinaryTree(),
s = new LinkedBinaryTree(),
d = new LinkedBinaryTree(),
f = new LinkedBinaryTree(),
m = new LinkedBinaryTree();
s.makeTree(new Integer(1), a, a);
d.makeTree(new Integer(2), a, a);
f.makeTree(new Integer(3), d, s);
y.makeTree(new Integer(4), a, a);
z.makeTree(new Integer(5), a, a);
x.makeTree(new Integer(6), y, z);
y.makeTree(new Integer(7), x, f);
System.out.print("Preorder ");
y.preOrderOutput();
System.out.println();
System.out.print("Inorder ");
y.inOrderOutput();
System.out.println();
System.out.print("Postorder ");
y.postOrderOutput();
System.out.println();
System.out.print("Level order ");
y.levelOrderOutput();
System.out.println();
System.out.print("Number of nodes = " + y.size());
System.out.println();
System.out.print("Height = " + y.height());
m = (LinkedBinaryTree) y.clone();
System.out.println();
System.out.print("Clone() : ");
m.inOrderOutput();
System.out.println();
System.out.print("SwapSubTrees(): ");
y.swapSubTrees();
System.out.println();
System.out.print("toList() : " + y.toList());
System.out.println();
y.tree();
y.max();
System.out.println("max() : " + max);
y.tree();
y.min();
System.out.println("min() : " + min);
}
}
********************************
package dataStructures;
public class MyChain extends Chain implements Cloneable{
public static void main(String[] args) {
MyChain newChain = new MyChain();
newChain.add(0, "4");
newChain.add(0, "0");
newChain.add(0, "2");
newChain.add(0, "s");
newChain.add(0, "c");
newChain.add(0, "l");
newChain.add(0, "a");
newChain.add(0, "b");
System.out.println("newChain: " + newChain);
//newChain: [b, a, l, c, s, 2, 0, 4]
MyChain clonedChain = (MyChain)newChain.clone();
System.out.println("clonedChain: " + clonedChain);
//clonedChain: [b, a, l, c, s, 2, 0, 4]
newChain.reverse(3);
System.out.println("newChainReverse(3): " + newChain);
//newChain.reverse(3): [l, a, b, c, s, 2, 0, 4]
newChain.shift(5);
System.out.println("newChain.shift(5):" + newChain);
//newChain.shift(5): [c, s, 2, 0, 4, l, a, b]
newChain.leftShift(5);
System.out.println("newChain.leftChain(5): " + newChain);
//newChain.leftShift(5): [l, a, b]
System.out.println("clonedChain after:" + clonedChain);
//clonedChain after: [b, a, l, c, s, 2, 0, 4]
}
public Object clone(){
Object clonedObject = null;
try {
clonedObject = super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return clonedObject;
}
public void leftShift(int n){
for(int i = 0; i < n; i++){
remove(0);
}
}
public void reverse(int i){
Object tempReverse[] = new Object[10];
for(int k = 0; k < i; k++){
tempReverse[k] = get(k);
}
for(int k = 0; k < i; k++){
remove(0);
}
for(int k = 0; k < i; k++){
add(0, tempReverse[k]);
}
}
public void shift(int i){
for(int k = 0; k add(size-1, remove(0));
}
}
}
package dataStructures;
import java.lang.reflect.*;
public class LinkedBinaryTree implements BinaryTree {
// instance data member
BinaryTreeNode root; // root node
// class data members
static Method visit; // visit method to use during a traversal
static Object[] visitArgs = new Object[1];
// parameters of visit method
static int count; // counter
static Class[] paramType = { BinaryTreeNode.class };
// type of parameter for visit
static Method theAdd1; // method to increment count by 1
static Method theOutput; // method to output node element
// method to initialize class data members
static {
try {
Class lbt = LinkedBinaryTree.class;
theAdd1 = lbt.getMethod("add1", paramType);
theOutput = lbt.getMethod("output", paramType);
} catch (Exception e) {
}
// exception not possible
}
// only default constructor available
// class methods
/** visit method that outputs element */
public static void output(BinaryTreeNode t) {
System.out.print(t.element + " ");
}
/** visit method to count nodes */
public static void add1(BinaryTreeNode t) {
count++;
}
// instance methods
/** @return true iff tree is empty */
public boolean isEmpty() {
return root == null;
}
/**
* @return root element if tree is not empty
* @return null if tree is empty
*/
public Object root() {
return (root == null) ? null : root.element;
}
/**
* set this to the tree with the given root and subtrees CAUTION: does not
* clone left and right
*/
public void makeTree(Object root, Object left, Object right) {
this.root = new BinaryTreeNode(root, ((LinkedBinaryTree) left).root,
((LinkedBinaryTree) right).root);
}
/**
* remove the left subtree
*
* @throws IllegalArgumentException
* when tree is empty
* @return removed subtree
*/
public BinaryTree removeLeftSubtree() {
if (root == null)
throw new IllegalArgumentException("tree is empty");
// detach left subtree and save in leftSubtree
LinkedBinaryTree leftSubtree = new LinkedBinaryTree();
leftSubtree.root = root.leftChild;
root.leftChild = null;
return (BinaryTree) leftSubtree;
}
/**
* remove the right subtree
*
* @throws IllegalArgumentException
* when tree is empty
* @return removed subtree
*/
public BinaryTree removeRightSubtree() {
if (root == null)
throw new IllegalArgumentException("tree is empty");
// detach right subtree and save in rightSubtree
LinkedBinaryTree rightSubtree = new LinkedBinaryTree();
rightSubtree.root = root.rightChild;
root.rightChild = null;
return (BinaryTree) rightSubtree;
}
/** preorder traversal */
public void preOrder(Method visit) {
this.visit = visit;
thePreOrder(root);
}
/** actual preorder traversal method */
static void thePreOrder(BinaryTreeNode t) {
if (t != null) {
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
thePreOrder(t.leftChild); // do left subtree
thePreOrder(t.rightChild); // do right subtree
}
}
/** inorder traversal */
public void inOrder(Method visit) {
this.visit = visit;
theInOrder(root);
}
/** actual inorder traversal method */
static void theInOrder(BinaryTreeNode t) {
if (t != null) {
theInOrder(t.leftChild); // do left subtree
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
theInOrder(t.rightChild); // do right subtree
}
}
/** postorder traversal */
public void postOrder(Method visit) {
this.visit = visit;
thePostOrder(root);
}
/** actual postorder traversal method */
static void thePostOrder(BinaryTreeNode t) {
if (t != null) {
thePostOrder(t.leftChild); // do left subtree
thePostOrder(t.rightChild); // do right subtree
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
}
}
/** level order traversal */
public void levelOrder(Method visit) {
ArrayQueue q = new ArrayQueue();
BinaryTreeNode t = root;
while (t != null) {
visitArgs[0] = t;
try {
visit.invoke(null, visitArgs);
} // visit tree root
catch (Exception e) {
System.out.println(e);
}
// put t's children on queue
if (t.leftChild != null)
q.put(t.leftChild);
if (t.rightChild != null)
q.put(t.rightChild);
// get next node to visit
t = (BinaryTreeNode) q.remove();
}
}
/** output elements in preorder */
public void preOrderOutput() {
preOrder(theOutput);
}
/** output elements in inorder */
public void inOrderOutput() {
inOrder(theOutput);
}
/** output elements in postorder */
public void postOrderOutput() {
postOrder(theOutput);
}
/** output elements in level order */
public void levelOrderOutput() {
levelOrder(theOutput);
}
/** count number of nodes in tree */
public int size() {
count = 0;
preOrder(theAdd1);
return count;
}
/** @return tree height */
public int height() {
return theHeight(root);
}
/** @return height of subtree rooted at t */
static int theHeight(BinaryTreeNode t) {
if (t == null)
return 0;
int hl = theHeight(t.leftChild); // height of left subtree
int hr = theHeight(t.rightChild); // height of right subtree
if (hl > hr)
return ++hl;
else
return ++hr;
}
/*******************MyLinkedBinaryTree*******************/
public Object clone() {
LinkedBinaryTree cloneObject = new LinkedBinaryTree();
cloneObject.root = Clone(root);
return cloneObject;
}
static BinaryTreeNode Clone(BinaryTreeNode a)
{
if (a == null)
return null;
else {
BinaryTreeNode b = new BinaryTreeNode(a.element);
b.leftChild = Clone(a.leftChild); //
b.rightChild = Clone(a.rightChild);
return b;
}
}
public void swapSubTrees(BinaryTreeNode node)
{
if (node != null)
{
// do the sub-trees
swapSubTrees(node.leftChild);
swapSubTrees(node.rightChild);
// baruun zuun zangilaanii bairiig solih
BinaryTreeNode temp = node.leftChild;
node.leftChild = node.rightChild;
node.rightChild = temp;
}
}
public void swapSubTrees() {
swapSubTrees(root);
inOrder(theOutput); //inOrder nevtrelteer hevlene
}
public MyChain toList() {
MyChain r = new MyChain();
treeToList(root, r);
//swapsubTrees()
return r;
}
private void treeToList(BinaryTreeNode node, MyChain goal) {
if (node != null)
{
treeToList(node.leftChild,goal);
int k = 0;
goal.add(k++, node.element);
treeToList(node.rightChild, goal);
}
}
BinaryTreeNode tree;
public void tree()
{tree = root;}
static int max = 0;
public void max() {
BinaryTreeNode node = tree;
if (max < Integer.parseInt(node.element.toString()))
{
max = Integer.parseInt(node.element.toString());
}
if (node.leftChild == null && node.rightChild == null)
;
else {
if (node.leftChild != null) {
tree = node.leftChild;
max();
} else {
if (node.rightChild == null) {
tree = node.rightChild;
max();
}
}
}
}
static int min = 100;
public void min() {
BinaryTreeNode node = tree;
if (min > Integer.parseInt(node.element.toString())) {
min = Integer.parseInt(node.element.toString());
}
if (node.leftChild == null && node.rightChild == null)
;
else
{
if (node.leftChild != null) {
tree = node.leftChild;
min();
} else
{
if (node.rightChild == null) {
tree = node.rightChild;
min();
}
}
}
}
/** test program */
public static void main(String[] args) {
LinkedBinaryTree a = new LinkedBinaryTree(),
x = new LinkedBinaryTree(),
y = new LinkedBinaryTree(),
z = new LinkedBinaryTree(),
s = new LinkedBinaryTree(),
d = new LinkedBinaryTree(),
f = new LinkedBinaryTree(),
m = new LinkedBinaryTree();
s.makeTree(new Integer(1), a, a);
d.makeTree(new Integer(2), a, a);
f.makeTree(new Integer(3), d, s);
y.makeTree(new Integer(4), a, a);
z.makeTree(new Integer(5), a, a);
x.makeTree(new Integer(6), y, z);
y.makeTree(new Integer(7), x, f);
System.out.print("Preorder ");
y.preOrderOutput();
System.out.println();
System.out.print("Inorder ");
y.inOrderOutput();
System.out.println();
System.out.print("Postorder ");
y.postOrderOutput();
System.out.println();
System.out.print("Level order ");
y.levelOrderOutput();
System.out.println();
System.out.print("Number of nodes = " + y.size());
System.out.println();
System.out.print("Height = " + y.height());
m = (LinkedBinaryTree) y.clone();
System.out.println();
System.out.print("Clone() : ");
m.inOrderOutput();
System.out.println();
System.out.print("SwapSubTrees(): ");
y.swapSubTrees();
System.out.println();
System.out.print("toList() : " + y.toList());
System.out.println();
y.tree();
y.max();
System.out.println("max() : " + max);
y.tree();
y.min();
System.out.println("min() : " + min);
}
}
********************************
package dataStructures;
public class MyChain extends Chain implements Cloneable{
public static void main(String[] args) {
MyChain newChain = new MyChain();
newChain.add(0, "4");
newChain.add(0, "0");
newChain.add(0, "2");
newChain.add(0, "s");
newChain.add(0, "c");
newChain.add(0, "l");
newChain.add(0, "a");
newChain.add(0, "b");
System.out.println("newChain: " + newChain);
//newChain: [b, a, l, c, s, 2, 0, 4]
MyChain clonedChain = (MyChain)newChain.clone();
System.out.println("clonedChain: " + clonedChain);
//clonedChain: [b, a, l, c, s, 2, 0, 4]
newChain.reverse(3);
System.out.println("newChainReverse(3): " + newChain);
//newChain.reverse(3): [l, a, b, c, s, 2, 0, 4]
newChain.shift(5);
System.out.println("newChain.shift(5):" + newChain);
//newChain.shift(5): [c, s, 2, 0, 4, l, a, b]
newChain.leftShift(5);
System.out.println("newChain.leftChain(5): " + newChain);
//newChain.leftShift(5): [l, a, b]
System.out.println("clonedChain after:" + clonedChain);
//clonedChain after: [b, a, l, c, s, 2, 0, 4]
}
public Object clone(){
Object clonedObject = null;
try {
clonedObject = super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return clonedObject;
}
public void leftShift(int n){
for(int i = 0; i < n; i++){
remove(0);
}
}
public void reverse(int i){
Object tempReverse[] = new Object[10];
for(int k = 0; k < i; k++){
tempReverse[k] = get(k);
}
for(int k = 0; k < i; k++){
remove(0);
}
for(int k = 0; k < i; k++){
add(0, tempReverse[k]);
}
}
public void shift(int i){
for(int k = 0; k add(size-1, remove(0));
}
}
}
Sunday, December 19, 2010
My Eiffel source code
note
description: "Lab1 application root class"
date: "$Date$"
revision: "$Revision$"
class
SE302
inherit
ARGUMENTS
create
make
feature
make
local
z: INTEGER
n: INTEGER
k: INTEGER
i: INTEGER
c: INTEGER
h: INTEGER
x, y: INTEGER
first_name, last_name, age, course: STRING
do
Io.read_integer_32
n := Io.last_integer_32
inspect n
when 1 then
z := 100
print ("Ta toogoo oruulna uu:")
Io.read_integer_32
x := io.last_integer_32
y := x // z
print ("Tanii oruulsan toond ")
io.put_integer_32 (y)
print (" zuut bn ")
when 2 then
Io.read_integer_32
k := io.last_integer_32
if k=1 then
print ("MONDAY ") end
if k=2 then
print ("TUESDAY ")end
if k=3 then
print ("WEDNESDAY ")end
if k=4 then
print ("THURSDAY ")end
if k=5 then
print ("FRIDAY ")end
if k=6 then
print ("SATURDAY ") end
if k=7 then
print ("SUNDAY ")
end
when 3 then
io.read_integer_32
x := io.last_integer_32
from
i := 0
until
i = x
loop
i := i + 1
io.put_integer (i)
end
when 4 then
print ("%NToogoo oruulna uu:")
io.read_integer_32
h := Io.last_integer_32
from
i := h
until
i = 1
loop
i := i - 1
h := h * (i)
end
print("%NTanii oruulsan toonii factorial")
io.put_integer_32 (h)
when 5 then
print("%N Ta neree oruulna uu:")
io.read_word
first_name:= io.last_string
print("%N Ta obog oo oruulna uu:")
io.read_word
last_name:=io.last_string
print("%N Ta nasaa oruulna uu:")
io.read_word
age:=io.last_string
print("%N Ta course oruulna uu:")
io.read_word
course:=io.last_string
print("%N Ta ner:") io.put_string (first_name)
print("%N Ta ovog:") io.put_string (last_name)
print("%N Ta nas:") io.put_string (age)
print("%N Ta course:") io.put_string (course)
when 6 then
when 7 then
else
print ("1-s 5-n hoorond too oruulah yostoi")
end
end
end -- class SE302
description: "Lab1 application root class"
date: "$Date$"
revision: "$Revision$"
class
SE302
inherit
ARGUMENTS
create
make
feature
make
local
z: INTEGER
n: INTEGER
k: INTEGER
i: INTEGER
c: INTEGER
h: INTEGER
x, y: INTEGER
first_name, last_name, age, course: STRING
do
Io.read_integer_32
n := Io.last_integer_32
inspect n
when 1 then
z := 100
print ("Ta toogoo oruulna uu:")
Io.read_integer_32
x := io.last_integer_32
y := x // z
print ("Tanii oruulsan toond ")
io.put_integer_32 (y)
print (" zuut bn ")
when 2 then
Io.read_integer_32
k := io.last_integer_32
if k=1 then
print ("MONDAY ") end
if k=2 then
print ("TUESDAY ")end
if k=3 then
print ("WEDNESDAY ")end
if k=4 then
print ("THURSDAY ")end
if k=5 then
print ("FRIDAY ")end
if k=6 then
print ("SATURDAY ") end
if k=7 then
print ("SUNDAY ")
end
when 3 then
io.read_integer_32
x := io.last_integer_32
from
i := 0
until
i = x
loop
i := i + 1
io.put_integer (i)
end
when 4 then
print ("%NToogoo oruulna uu:")
io.read_integer_32
h := Io.last_integer_32
from
i := h
until
i = 1
loop
i := i - 1
h := h * (i)
end
print("%NTanii oruulsan toonii factorial")
io.put_integer_32 (h)
when 5 then
print("%N Ta neree oruulna uu:")
io.read_word
first_name:= io.last_string
print("%N Ta obog oo oruulna uu:")
io.read_word
last_name:=io.last_string
print("%N Ta nasaa oruulna uu:")
io.read_word
age:=io.last_string
print("%N Ta course oruulna uu:")
io.read_word
course:=io.last_string
print("%N Ta ner:") io.put_string (first_name)
print("%N Ta ovog:") io.put_string (last_name)
print("%N Ta nas:") io.put_string (age)
print("%N Ta course:") io.put_string (course)
when 6 then
when 7 then
else
print ("1-s 5-n hoorond too oruulah yostoi")
end
end
end -- class SE302
Thursday, December 16, 2010
DotA map 6.68c
DotA 6.68c AI is the upcoming DotA AI map which is under development process and expected to release very soon. Harreke & PleaseBugMeNot are currently working on DotA v6.68c AI Project. Harreke is developing his own AI script and PleaseBugMeNot is following BMP's AI script. So there may be two versions of 6.68c AI this time.
Update #4: Beta Map:
Update #2: Quick Update (October 27, 2010):
Update #1: PleaseBugMeNot:
Anyway, This post is created for DotA Allstars 6.68c AI Plus map. It will cover all the news and updates of this AI map.
Source :http://www.dota-utilities.com/
Update #4: Beta Map:
The 6.68c AI beta map is now out for a while. It's not an official release but it's still playable, thanks to the Armenian.Update #3: Quick Update (November 27, 2010):
Download:
DotA 6.68c AI Beta.rar (7.36 MB)
Note: This map will appear as "Dota 6.68c" in Warcraft 3 map list, so it is recommended that you put it in a separate folder.
Second BETA stage
After some testing, the most crucial bug is not appearing. Now i`m starting to make some AI changes and another BETA will be rolling. If no crucial BUGs appear... we can release 6.68c AI BETA map to the public. I also got 6.69`s changes and i`ll begin working on moving the 6.69`s AI map.
Update #2: Quick Update (October 27, 2010):
Hello, guys.
Just a quick update on the status of the AI map. The item builds for DotA 6.68c AI series are ready. The AITeam are testing them. As you know in 6.69 there are changes in some items and recipes and that will need another item build overhaul. There is a new mode called -ld (Low Dodge Mode). Some users complained how AI (Normal and Hard) are dodging almost always Pudge`s Hooks and some other skills. The mode will compensate that problem... it will be available as a command from the hosting player. Writing -old once will enable that mode and writing it again will disable it. You`ll see a message with the current status of the mode.
That mode affects Meat Hook but also Nerubian Assassin's Impale, Demon Witch's Impale, Fissure, and Ice Path.
There are some weird bugs which we will address. Also i started renaming and de-obfuscating a lot of functions and variables... i hope that will make the work on the script easier.
Update #1: PleaseBugMeNot:
And here is the test of the Eredar, Shadow Demon. All skills are working. Gyrocopter and Thrall are already working. I can say the waiting for 6.68 was worth it, very nice heroes. Congrats, IceFrog! The next work on the list, making item recipes work. Without that fix, the map will be unplayable. So, keep your fingers crossed.
Screenshots:
Anyway, This post is created for DotA Allstars 6.68c AI Plus map. It will cover all the news and updates of this AI map.
Source :http://www.dota-utilities.com/
Subscribe to:
Posts (Atom)


