Previous capture 27 Next capture
2012 2013 2014
5 captures
15 Feb 13 - 20 Aug 13
Close Help

-- edit xTalk in this box.

put 3 + 7 * 9 && "is as good as" && three plus seven times nine

ask "If x squared is" && quote & 3.1415^2 & quote & comma && "then x = " with "pi
get the result

put "Unanswered questions count against your score." into importantMessage
if it is empty then
answer importantMessage
else if it is "pi" then put "Pi is correct
else answer it && "is incorrect.

get the ticks
put 10 into busywork

repeat with index = 1 to 10^7
put (busywork*2 + 9) into busywork
put busywork mod 369 into busywork
end repeat
put "Calculated" && busywork && "in elapsed ticks:" && the ticks - it

on batsignal param, param2
answer param && param2
end batsignal -- Joker you diabolical

function identity hero
if hero is batman then return "bruce wayne"
else return "...WHO!?"
end identity

batsignal "we need", identity(batman)

put "one, two, three, four, five" into vholder
if the number of characters in vholder is more than or equal to five
then repeat with x = 1 to 5
if x mod 3 is 0 then put item x of vholder && x
end repeat

class animal -- declares animal to be a type of object that can exist
on speak
put "Animal sounds."
on sleep
put "ZZZZZZ," && my name && "is sleepy."
end class

get a new animal
put "Howard the Duck" into the name of it
send sleep to it

put "Do tricks now?" into tricksmessage

class dog extends animal -- declares a new type based on animal

on doTricks
if confirm(tricksMessage) then
send speak to me
send sleep to me

on speak
answer "Ruff! Ruff! Bow-wow-wow!"

end class

put a new dog into wolfie
set wolfie's name to item 2 of "Mr. Peeks,Mr. Hoods,Mr. Scrumps"
send doTricks to wolfie
Show conversion below
var it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak,sleep,tricksmessage,doTricks,Dog,wolfie;

/* edit xTalk in this box. */

window.putToConsole([3+7*9,' ',"is as good as",' ',3+7*9].join(''));

var result = window.prompt(["If x squared is",' ','"',Math.pow(3.1415,2),'"',",",' ',"then x = "].join(''),"pi");

importantmessage="Unanswered questions count against your score.";
if (it==null) {
}/*end then*/
else if (it=="pi") window.putToConsole("Pi is correct");
else window.alert([it,' ',"is incorrect."].join(''));

it=Math.round(new Date().getTime() * 60.5 / 1000);

for (index = 1; index <= Math.pow(10,7); index++) {
}/*end repeat*/
window.putToConsole(["Calculated",' ',busywork,' ',"in elapsed ticks:",' ',Math.round(new Date().getTime() * 60.5 / 1000)-it].join(''));

function batsignal(param, param2)
{ var param,param2; /* it,importantmessage,busywork,index,batsignal,param,param2 */
window.alert([param,' ',param2].join(''));
}/*end batsignal*/ /* Joker you diabolical */

function identity(hero)
{ var hero; /* it,importantmessage,busywork,index,batsignal,identity,hero */
if (hero=="batman") return "bruce wayne";
else return "...WHO!?";
}/*end identity*/

result=batsignal("we need", identity("batman"));

vholder="one, two, three, four, five";
if (new String(vholder).length>=5)
for (x = 1; x <= 5; x++) {
if (x%3==0) window.putToConsole([vholder.split(',')[(x)-1],' ',x].join(''));
}/*end repeat*/

var Animal = (function() { /* declares animal to be a type of object that can exist */
function constructor() { };
{ /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak */
window.putToConsole("Animal sounds.");
}/*end speak*/
{ /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak,sleep */
window.putToConsole(["ZZZZZZ,",' ',this.name,' ',"is sleepy."].join(''));
}/*end sleep*/
return constructor; /*end Animal*/ })();

it=new Animal();
it.name = "Howard the Duck";
var result = it.sleep();

tricksmessage="Do tricks now?";

var Dog = (function(__superclass) { /* declares a new type based on animal */
(__superclass = function() { this.constructor = constructor; }).prototype = Animal.prototype;
constructor.prototype = new __superclass();
function constructor() { Animal.apply(this,arguments); };

{ /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak,sleep,tricksmessage,doTricks */
if (confirm(tricksmessage)) {
var result = this.speak();
var result = this.sleep();

}/*end then*/

}/*end doTricks*/
{ /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak,sleep,tricksmessage,doTricks */
window.alert("Ruff! Ruff! Bow-wow-wow!");

}/*end speak*/
return constructor; /*end Dog*/ })(null);

wolfie=new Dog();
wolfie.name="Mr. Peeks,Mr. Hoods,Mr. Scrumps".split(',')[(2)-1];
var result = wolfie.doTricks();