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 itis empty then answer importantMessage else if itis"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 busyworkmod369 into busywork end repeat put "Calculated"&&busywork&&"in elapsed ticks:"&& the ticks -it
on batsignalparam, param2 answer param&¶m2 end batsignal-- Joker you diabolical
function identityhero if heroisbatmanthen 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 vholderis more than or equal to five then repeat with x = 1 to 5 if xmod3is0then 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"); it=result;
importantmessage="Unanswered questions count against your score."; if (it==null) { window.alert(importantmessage); }/*end then*/ else if (it=="pi") window.putToConsole("Pi is correct"); else window.alert([it,' ',"is incorrect."].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() { }; constructor.prototype.speak=function() { /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak */ window.putToConsole("Animal sounds."); }/*end speak*/ constructor.prototype.sleep=function() { /* 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); };
constructor.prototype.doTricks=function() { /* it,importantmessage,busywork,index,batsignal,identity,vholder,x,Animal,speak,sleep,tricksmessage,doTricks */ if (confirm(tricksmessage)) { var result = this.speak(); var result = this.sleep();