How to use block2 method in ng-mocks

Best JavaScript code snippet using ng-mocks

multCondStims.js

Source:multCondStims.js Github

copy

Full Screen

1var list1 =2[{list:"1",3id:"1",4idCondition:"1-R",5orientation:"R",6block1_speakerGender:"Female",7block1_speakerName:"Mary",8block1_subjectName:"Frank",9block1_subjectGender:"Male",10block2_speakerGender:"Female",11block2_speakerName:"Judith",12block2_subjectGender:"Male",13block2_subjectName:"Gordon",14topic:"abortion",15predicate:"know",16complement:"abortion rights should be reduced",17complementType:"abstract-should"},18 {list:"1",19id:"2",20idCondition:"2-R",21orientation:"R",22block1_speakerGender:"Female",23block1_speakerName:"Katie",24block1_subjectName:"Jeff",25block1_subjectGender:"Male",26block2_speakerGender:"Female",27block2_speakerName:"Jane",28block2_subjectGender:"Male",29block2_subjectName:"Brad",30topic:"abortion-2",31predicate:"realize",32complement:"abortion is unethical",33complementType:"?"},34 {list:"1",35id:"3",36idCondition:"3-L",37orientation:"L",38block1_speakerGender:"Female",39block1_speakerName:"Maria",40block1_subjectName:"Elizabeth",41block1_subjectGender:"Female",42block2_speakerGender:"Female",43block2_speakerName:"Wendy",44block2_subjectGender:"Female",45block2_subjectName:"Natasha",46topic:"affirmative action",47predicate:"discover",48complement:"affirmative action programs ensure equal access to jobs",49complementType:"concrete"},50 {list:"1",51id:"29",52idCondition:"29-N",53orientation:"N",54block1_speakerGender:"Male",55block1_speakerName:"Noah",56block1_subjectName:"John",57block1_subjectGender:"Male",58block2_speakerGender:"Male",59block2_speakerName:"Ian",60block2_subjectGender:"Male",61block2_subjectName:"Clark",62topic:"break",63predicate:"feel",64complement:"there needs to be a break half-way through the meeting",65complementType:"abstract"},66 {list:"1",67id:"4",68idCondition:"4-L",69orientation:"L",70block1_speakerGender:"Male",71block1_speakerName:"Fred",72block1_subjectName:"Martha",73block1_subjectGender:"Female",74block2_speakerGender:"Male",75block2_speakerName:"Evan",76block2_subjectGender:"Female",77block2_subjectName:"Andrea",78topic:"capital punishment",79predicate:"realize",80complement:"the federal government should ban capital punishment",81complementType:"abstract"},82 {list:"1",83id:"30",84idCondition:"30-N",85orientation:"N",86block1_speakerGender:"Female",87block1_speakerName:"Nancy",88block1_subjectName:"Tom",89block1_subjectGender:"Male",90block2_speakerGender:"Female",91block2_speakerName:"Theresa",92block2_subjectGender:"Male",93block2_subjectName:"George",94topic:"disorganized",95predicate:"see",96complement:"club meetings are too disorganized",97complementType:"abstract"},98 {list:"1",99id:"5",100idCondition:"5-L",101orientation:"L",102block1_speakerGender:"Male",103block1_speakerName:"Luke",104block1_subjectName:"Andy",105block1_subjectGender:"Male",106block2_speakerGender:"Male",107block2_speakerName:"Don",108block2_subjectGender:"Male",109block2_subjectName:"Jim",110topic:"environmental laws",111predicate:"feel",112complement:"there are too few environmental laws",113complementType:"abstract"},114 {list:"1",115id:"31",116idCondition:"31-N",117orientation:"N",118block1_speakerGender:"Female",119block1_speakerName:"Rosie",120block1_subjectName:"Lily",121block1_subjectGender:"Female",122block2_speakerGender:"Female",123block2_speakerName:"Esther",124block2_subjectGender:"Female",125block2_subjectName:"Felicia",126topic:"fundraiser",127predicate:"realize",128complement:"the club fundraiser is next week",129complementType:"concrete"},130 {list:"1",131id:"6",132idCondition:"6-L",133orientation:"L",134block1_speakerGender:"Female",135block1_speakerName:"Sandra",136block1_subjectName:"Ashley",137block1_subjectGender:"Female",138block2_speakerGender:"Female",139block2_speakerName:"Debbie",140block2_subjectGender:"Female",141block2_subjectName:"Kathleen",142topic:"gay marriage",143predicate:"think",144complement:"same-sex couples should be allowed to marry",145complementType:"abstract-should"},146 {list:"1",147id:"7",148idCondition:"7-R",149orientation:"R",150block1_speakerGender:"Male",151block1_speakerName:"Brian",152block1_subjectName:"Jake",153block1_subjectGender:"Male",154block2_speakerGender:"Male",155block2_speakerName:"Ted",156block2_subjectGender:"Male",157block2_subjectName:"Justin",158topic:"gun laws ",159predicate:"think",160complement:"strict gun control laws prevent mass shootings",161complementType:"concrete"},162 {list:"1",163id:"8",164idCondition:"8-L",165orientation:"L",166block1_speakerGender:"Male",167block1_speakerName:"Derek",168block1_subjectName:"Lisa",169block1_subjectGender:"Female",170block2_speakerGender:"Male",171block2_speakerName:"Richard",172block2_subjectGender:"Female",173block2_subjectName:"Vicky",174topic:"guns and teachers",175predicate:"know",176complement:"schoolteachers carrying guns threatens student safety",177complementType:"concrete"},178 {list:"1",179id:"9",180idCondition:"9-R",181orientation:"R",182block1_speakerGender:"Male",183block1_speakerName:"Rob",184block1_subjectName:"Bill",185block1_subjectGender:"Male",186block2_speakerGender:"Male",187block2_speakerName:"Martin",188block2_subjectGender:"Male",189block2_subjectName:"Gabe",190topic:"healthcare",191predicate:"discover",192complement:"the government should stay out of the healthcare system",193complementType:"abstract-should"},194 {list:"1",195id:"10",196idCondition:"10-R",197orientation:"R",198block1_speakerGender:"Male",199block1_speakerName:"Steve",200block1_subjectName:"Alice",201block1_subjectGender:"Female",202block2_speakerGender:"Male",203block2_speakerName:"Nicholas",204block2_subjectGender:"Female",205block2_subjectName:"Jennifer",206topic:"immmigration",207predicate:"see",208complement:"immigrants steal jobs from Americans",209complementType:"concrete"},210 {list:"1",211id:"32",212idCondition:"32-N",213orientation:"N",214block1_speakerGender:"Male",215block1_speakerName:"Isaac",216block1_subjectName:"James",217block1_subjectGender:"Male",218block2_speakerGender:"Male",219block2_speakerName:"Greg",220block2_subjectGender:"Male",221block2_subjectName:"Tim",222topic:"lighting",223predicate:"think",224complement:"the room needs more lighting",225complementType:"abstract"},226 {list:"1",227id:"11",228idCondition:"11-L",229orientation:"L",230block1_speakerGender:"Male",231block1_speakerName:"David",232block1_subjectName:"Anna",233block1_subjectGender:"Female",234block2_speakerGender:"Male",235block2_speakerName:"Aaron",236block2_subjectGender:"Female",237block2_subjectName:"Rhonda",238topic:"medicaid",239predicate:"believe",240complement:"medicaid funding should be increased",241complementType:"abstract-should"},242 {list:"1",243id:"33",244idCondition:"33-N",245orientation:"N",246block1_speakerGender:"Female",247block1_speakerName:"Jessica",248block1_subjectName:"Megan",249block1_subjectGender:"Female",250block2_speakerGender:"Female",251block2_speakerName:"Amber",252block2_subjectGender:"Female",253block2_subjectName:"Mandy",254topic:"meeting location",255predicate:"know",256complement:"the club meeting location needs to be changed",257complementType:"abstract-should"},258 {list:"1",259id:"34",260idCondition:"34-N",261orientation:"N",262block1_speakerGender:"Female",263block1_speakerName:"Emily",264block1_subjectName:"Caleb",265block1_subjectGender:"Male",266block2_speakerGender:"Female",267block2_speakerName:"Tina",268block2_subjectGender:"Male",269block2_subjectName:"Ethan",270topic:"newsletter",271predicate:"discover",272complement:"the club newsletter will be sent next month",273complementType:"concrete"},274 {list:"1",275id:"12",276idCondition:"12-R",277orientation:"R",278block1_speakerGender:"Female",279block1_speakerName:"Cindy",280block1_subjectName:"Ben",281block1_subjectGender:"Male",282block2_speakerGender:"Female",283block2_speakerName:"Celia",284block2_subjectGender:"Male",285block2_subjectName:"Peter",286topic:"Obama",287predicate:"believe",288complement:"Obama damaged the American economy",289complementType:"concrete"},290 {list:"1",291id:"35",292idCondition:"35-N",293orientation:"N",294block1_speakerGender:"Male",295block1_speakerName:"Nathan",296block1_subjectName:"Clara",297block1_subjectGender:"Female",298block2_speakerGender:"Male",299block2_speakerName:"Bruce",300block2_subjectGender:"Female",301block2_subjectName:"Julie",302topic:"registration",303predicate:"believe",304complement:"the club registration forms were sent in the mail",305complementType:"concrete"},306 {list:"1",307id:"13",308idCondition:"13-L",309orientation:"L",310block1_speakerGender:"Female",311block1_speakerName:"Linda",312block1_subjectName:"Roger",313block1_subjectGender:"Male",314block2_speakerGender:"Female",315block2_speakerName:"Charlotte",316block2_subjectGender:"Male",317block2_subjectName:"Brandon",318topic:"the wall",319predicate:"see",320complement:"the government should refuse to fund the border wall",321complementType:"abstract-should"},322 {list:"1",323id:"14",324idCondition:"14-R",325orientation:"R",326block1_speakerGender:"Female",327block1_speakerName:"Allison",328block1_subjectName:"Laura",329block1_subjectGender:"Female",330block2_speakerGender:"Female",331block2_speakerName:"Valerie",332block2_subjectGender:"Female",333block2_subjectName:"Alaina",334topic:"Trump",335predicate:"feel",336complement:"Trump\'s national security policies make Americans safer",337complementType:"concrete"},338 {list:"1",339id:"filler1",340idCondition:"filler1",341orientation:"NONE",342block1_speakerGender:"Female",343block1_speakerName:"Rita",344block1_subjectName:"Simon",345block1_subjectGender:"Male",346block2_speakerGender:"Female",347block2_speakerName:"Carly",348block2_subjectGender:"Male",349block2_subjectName:"Alan",350topic:"cookies",351predicate:"NONE",352complement:"brought the cookies for dessert",353complementType:"NONE"},354 {list:"1",355id:"filler2",356idCondition:"filler2",357orientation:"NONE",358block1_speakerGender:"Male",359block1_speakerName:"Daniel",360block1_subjectName:"Caroline",361block1_subjectGender:"Female",362block2_speakerGender:"Male",363block2_speakerName:"Larry",364block2_subjectGender:"Female",365block2_subjectName:"Olivia",366topic:"sick",367predicate:"NONE",368complement:"missed the meeting because she\'s sick",369complementType:"NONE"}];370var list2 =371[{list:"2",372id:"1",373idCondition:"1-L",374orientation:"L",375block1_speakerGender:"Female",376block1_speakerName:"Mary",377block1_subjectName:"Frank",378block1_subjectGender:"Male",379block2_speakerGender:"Female",380block2_speakerName:"Judith",381block2_subjectGender:"Male",382block2_subjectName:"Gordon",383topic:"abortion",384predicate:"know",385complement:"abortion rights should be expanded",386complementType:"abstract-should"},387 {list:"2",388id:"2",389idCondition:"2-L",390orientation:"L",391block1_speakerGender:"Female",392block1_speakerName:"Katie",393block1_subjectName:"Jeff",394block1_subjectGender:"Male",395block2_speakerGender:"Female",396block2_speakerName:"Jane",397block2_subjectGender:"Male",398block2_subjectName:"Brad",399topic:"abortion-2",400predicate:"realize",401complement:"abortion is a woman\'s right",402complementType:"?"},403 {list:"2",404id:"3",405idCondition:"3-R",406orientation:"R",407block1_speakerGender:"Female",408block1_speakerName:"Maria",409block1_subjectName:"Elizabeth",410block1_subjectGender:"Female",411block2_speakerGender:"Female",412block2_speakerName:"Wendy",413block2_subjectGender:"Female",414block2_subjectName:"Natasha",415topic:"affirmative action",416predicate:"discover",417complement:"affirmative action programs drain government resources",418complementType:"concrete"},419 {list:"2",420id:"36",421idCondition:"36-N",422orientation:"N",423block1_speakerGender:"Male",424block1_speakerName:"Noah",425block1_subjectName:"John",426block1_subjectGender:"Male",427block2_speakerGender:"Male",428block2_speakerName:"Ian",429block2_subjectGender:"Male",430block2_subjectName:"Clark",431topic:"break",432predicate:"see",433complement:"there needs to be a break half-way through the meeting",434complementType:"abstract"},435 {list:"2",436id:"4",437idCondition:"4-R",438orientation:"R",439block1_speakerGender:"Male",440block1_speakerName:"Fred",441block1_subjectName:"Martha",442block1_subjectGender:"Female",443block2_speakerGender:"Male",444block2_speakerName:"Evan",445block2_subjectGender:"Female",446block2_subjectName:"Andrea",447topic:"capital punishment",448predicate:"realize",449complement:"all states should allow capital punishment",450complementType:"abstract"},451 {list:"2",452id:"37",453idCondition:"37-N",454orientation:"N",455block1_speakerGender:"Female",456block1_speakerName:"Nancy",457block1_subjectName:"Tom",458block1_subjectGender:"Male",459block2_speakerGender:"Female",460block2_speakerName:"Theresa",461block2_subjectGender:"Male",462block2_subjectName:"George",463topic:"disorganized",464predicate:"feel",465complement:"club meetings are too disorganized",466complementType:"abstract"},467 {list:"2",468id:"5",469idCondition:"5-R",470orientation:"R",471block1_speakerGender:"Male",472block1_speakerName:"Luke",473block1_subjectName:"Andy",474block1_subjectGender:"Male",475block2_speakerGender:"Male",476block2_speakerName:"Don",477block2_subjectGender:"Male",478block2_subjectName:"Jim",479topic:"environmental laws",480predicate:"feel",481complement:"there are too many environmental laws",482complementType:"abstract"},483 {list:"2",484id:"38",485idCondition:"38-N",486orientation:"N",487block1_speakerGender:"Female",488block1_speakerName:"Rosie",489block1_subjectName:"Lily",490block1_subjectGender:"Female",491block2_speakerGender:"Female",492block2_speakerName:"Esther",493block2_subjectGender:"Female",494block2_subjectName:"Felicia",495topic:"fundraiser",496predicate:"think",497complement:"the club fundraiser is next week",498complementType:"concrete"},499 {list:"2",500id:"6",501idCondition:"6-R",502orientation:"R",503block1_speakerGender:"Female",504block1_speakerName:"Sandra",505block1_subjectName:"Ashley",506block1_subjectGender:"Female",507block2_speakerGender:"Female",508block2_speakerName:"Debbie",509block2_subjectGender:"Female",510block2_subjectName:"Kathleen",511topic:"gay marriage",512predicate:"think",513complement:"only heterosexual couples should be allowed to marry",514complementType:"abstract-should"},515 {list:"2",516id:"7",517idCondition:"7-L",518orientation:"L",519block1_speakerGender:"Male",520block1_speakerName:"Brian",521block1_subjectName:"Jake",522block1_subjectGender:"Male",523block2_speakerGender:"Male",524block2_speakerName:"Ted",525block2_subjectGender:"Male",526block2_subjectName:"Justin",527topic:"gun laws ",528predicate:"think",529complement:"strict gun control laws prevent mass shootings",530complementType:"concrete"},531 {list:"2",532id:"8",533idCondition:"8-R",534orientation:"R",535block1_speakerGender:"Male",536block1_speakerName:"Derek",537block1_subjectName:"Lisa",538block1_subjectGender:"Female",539block2_speakerGender:"Male",540block2_speakerName:"Richard",541block2_subjectGender:"Female",542block2_subjectName:"Vicky",543topic:"guns and teachers",544predicate:"know",545complement:"schoolteachers carrying guns promotes student safety",546complementType:"concrete"},547 {list:"2",548id:"9",549idCondition:"9-L",550orientation:"L",551block1_speakerGender:"Male",552block1_speakerName:"Rob",553block1_subjectName:"Bill",554block1_subjectGender:"Male",555block2_speakerGender:"Male",556block2_speakerName:"Martin",557block2_subjectGender:"Male",558block2_subjectName:"Gabe",559topic:"healthcare",560predicate:"discover",561complement:"the government should run the healthcare system",562complementType:"abstract-should"},563 {list:"2",564id:"10",565idCondition:"10-L",566orientation:"L",567block1_speakerGender:"Male",568block1_speakerName:"Steve",569block1_subjectName:"Alice",570block1_subjectGender:"Female",571block2_speakerGender:"Male",572block2_speakerName:"Nicholas",573block2_subjectGender:"Female",574block2_subjectName:"Jennifer",575topic:"immmigration",576predicate:"see",577complement:"immigrants support the American economy",578complementType:"concrete"},579 {list:"2",580id:"39",581idCondition:"39-N",582orientation:"N",583block1_speakerGender:"Male",584block1_speakerName:"Isaac",585block1_subjectName:"James",586block1_subjectGender:"Male",587block2_speakerGender:"Male",588block2_speakerName:"Greg",589block2_subjectGender:"Male",590block2_subjectName:"Tim",591topic:"lighting",592predicate:"know",593complement:"the room needs more lighting",594complementType:"abstract"},595 {list:"2",596id:"11",597idCondition:"11-R",598orientation:"R",599block1_speakerGender:"Male",600block1_speakerName:"David",601block1_subjectName:"Anna",602block1_subjectGender:"Female",603block2_speakerGender:"Male",604block2_speakerName:"Aaron",605block2_subjectGender:"Female",606block2_subjectName:"Rhonda",607topic:"medicaid",608predicate:"believe",609complement:"medicaid funding should be decreased",610complementType:"abstract-should"},611 {list:"2",612id:"40",613idCondition:"40-N",614orientation:"N",615block1_speakerGender:"Female",616block1_speakerName:"Jessica",617block1_subjectName:"Megan",618block1_subjectGender:"Female",619block2_speakerGender:"Female",620block2_speakerName:"Amber",621block2_subjectGender:"Female",622block2_subjectName:"Mandy",623topic:"meeting location",624predicate:"believe",625complement:"the club meeting location needs to be changed",626complementType:"abstract-should"},627 {list:"2",628id:"41",629idCondition:"41-N",630orientation:"N",631block1_speakerGender:"Female",632block1_speakerName:"Emily",633block1_subjectName:"Caleb",634block1_subjectGender:"Male",635block2_speakerGender:"Female",636block2_speakerName:"Tina",637block2_subjectGender:"Male",638block2_subjectName:"Ethan",639topic:"newsletter",640predicate:"realize",641complement:"the club newsletter will be sent next month",642complementType:"concrete"},643 {list:"2",644id:"12",645idCondition:"12-L",646orientation:"L",647block1_speakerGender:"Female",648block1_speakerName:"Cindy",649block1_subjectName:"Ben",650block1_subjectGender:"Male",651block2_speakerGender:"Female",652block2_speakerName:"Celia",653block2_subjectGender:"Male",654block2_subjectName:"Peter",655topic:"Obama",656predicate:"believe",657complement:"Obama improved the American economy",658complementType:"concrete"},659 {list:"2",660id:"42",661idCondition:"42-N",662orientation:"N",663block1_speakerGender:"Male",664block1_speakerName:"Nathan",665block1_subjectName:"Clara",666block1_subjectGender:"Female",667block2_speakerGender:"Male",668block2_speakerName:"Bruce",669block2_subjectGender:"Female",670block2_subjectName:"Julie",671topic:"registration",672predicate:"discover",673complement:"the club registration forms were sent in the mail",674complementType:"concrete"},675 {list:"2",676id:"13",677idCondition:"13-R",678orientation:"R",679block1_speakerGender:"Female",680block1_speakerName:"Linda",681block1_subjectName:"Roger",682block1_subjectGender:"Male",683block2_speakerGender:"Female",684block2_speakerName:"Charlotte",685block2_subjectGender:"Male",686block2_subjectName:"Brandon",687topic:"the wall",688predicate:"see",689complement:"the government should fund the border wall",690complementType:"abstract-should"},691 {list:"2",692id:"14",693idCondition:"14-L",694orientation:"L",695block1_speakerGender:"Female",696block1_speakerName:"Allison",697block1_subjectName:"Laura",698block1_subjectGender:"Female",699block2_speakerGender:"Female",700block2_speakerName:"Valerie",701block2_subjectGender:"Female",702block2_subjectName:"Alaina",703topic:"Trump",704predicate:"feel",705complement:"Trump\'s national security policies put Americans in danger",706complementType:"concrete"},707 {list:"2",708id:"filler1",709idCondition:"filler1",710orientation:"NONE",711block1_speakerGender:"Female",712block1_speakerName:"Rita",713block1_subjectName:"Simon",714block1_subjectGender:"Male",715block2_speakerGender:"Female",716block2_speakerName:"Carly",717block2_subjectGender:"Male",718block2_subjectName:"Alan",719topic:"cookies",720predicate:"NONE",721complement:"brought the cookies for dessert",722complementType:"NONE"},723 {list:"2",724id:"filler2",725idCondition:"filler2",726orientation:"NONE",727block1_speakerGender:"Male",728block1_speakerName:"Daniel",729block1_subjectName:"Caroline",730block1_subjectGender:"Female",731block2_speakerGender:"Male",732block2_speakerName:"Larry",733block2_subjectGender:"Female",734block2_subjectName:"Olivia",735topic:"sick",736predicate:"NONE",737complement:"missed the meeting because she\'s sick",738complementType:"NONE"}];739var list3 =740[{list:"3",741id:"15",742idCondition:"15-R",743orientation:"R",744block1_speakerGender:"Female",745block1_speakerName:"Mary",746block1_subjectName:"Frank",747block1_subjectGender:"Male",748block2_speakerGender:"Female",749block2_speakerName:"Judith",750block2_subjectGender:"Male",751block2_subjectName:"Gordon",752topic:"abortion",753predicate:"believe",754complement:"abortion rights should be reduced",755complementType:"abstract-should"},756 {list:"3",757id:"16",758idCondition:"16-L",759orientation:"L",760block1_speakerGender:"Female",761block1_speakerName:"Katie",762block1_subjectName:"Jeff",763block1_subjectGender:"Male",764block2_speakerGender:"Female",765block2_speakerName:"Jane",766block2_subjectGender:"Male",767block2_subjectName:"Brad",768topic:"abortion-2",769predicate:"think",770complement:"abortion is a woman\'s right",771complementType:"?"},772 {list:"3",773id:"17",774idCondition:"17-L",775orientation:"L",776block1_speakerGender:"Female",777block1_speakerName:"Maria",778block1_subjectName:"Elizabeth",779block1_subjectGender:"Female",780block2_speakerGender:"Female",781block2_speakerName:"Wendy",782block2_subjectGender:"Female",783block2_subjectName:"Natasha",784topic:"affirmative action",785predicate:"see",786complement:"affirmative action programs ensure equal access to jobs",787complementType:"concrete"},788 {list:"3",789id:"18",790idCondition:"18-L",791orientation:"L",792block1_speakerGender:"Male",793block1_speakerName:"Noah",794block1_subjectName:"John",795block1_subjectGender:"Male",796block2_speakerGender:"Male",797block2_speakerName:"Ian",798block2_subjectGender:"Male",799block2_subjectName:"Clark",800topic:"capital punishment",801predicate:"feel",802complement:"the federal government should ban capital punishment",803complementType:"abstract"},804 {list:"3",805id:"43",806idCondition:"43-N",807orientation:"N",808block1_speakerGender:"Male",809block1_speakerName:"Fred",810block1_subjectName:"Martha",811block1_subjectGender:"Female",812block2_speakerGender:"Male",813block2_speakerName:"Evan",814block2_subjectGender:"Female",815block2_subjectName:"Andrea",816topic:"earlier",817predicate:"see",818complement:"club meetings need to start earlier",819complementType:"abstract-should"},820 {list:"3",821id:"19",822idCondition:"19-L",823orientation:"L",824block1_speakerGender:"Female",825block1_speakerName:"Nancy",826block1_subjectName:"Tom",827block1_subjectGender:"Male",828block2_speakerGender:"Female",829block2_speakerName:"Theresa",830block2_subjectGender:"Male",831block2_subjectName:"George",832topic:"environmental laws",833predicate:"discover",834complement:"there are too few environmental laws",835complementType:"abstract"},836 {list:"3",837id:"20",838idCondition:"20-L",839orientation:"L",840block1_speakerGender:"Male",841block1_speakerName:"Luke",842block1_subjectName:"Andy",843block1_subjectGender:"Male",844block2_speakerGender:"Male",845block2_speakerName:"Don",846block2_subjectGender:"Male",847block2_subjectName:"Jim",848topic:"gay marriage",849predicate:"realize",850complement:"same-sex couples should be allowed to marry",851complementType:"abstract-should"},852 {list:"3",853id:"21",854idCondition:"21-R",855orientation:"R",856block1_speakerGender:"Female",857block1_speakerName:"Rosie",858block1_subjectName:"Lily",859block1_subjectGender:"Female",860block2_speakerGender:"Female",861block2_speakerName:"Esther",862block2_subjectGender:"Female",863block2_subjectName:"Felicia",864topic:"gun laws ",865predicate:"realize",866complement:"strict gun control laws prevent mass shootings",867complementType:"concrete"},868 {list:"3",869id:"22",870idCondition:"22-L",871orientation:"L",872block1_speakerGender:"Female",873block1_speakerName:"Sandra",874block1_subjectName:"Ashley",875block1_subjectGender:"Female",876block2_speakerGender:"Female",877block2_speakerName:"Debbie",878block2_subjectGender:"Female",879block2_subjectName:"Kathleen",880topic:"guns and teachers",881predicate:"believe",882complement:"schoolteachers carrying guns threatens student safety",883complementType:"concrete"},884 {list:"3",885id:"23",886idCondition:"23-R",887orientation:"R",888block1_speakerGender:"Male",889block1_speakerName:"Brian",890block1_subjectName:"Jake",891block1_subjectGender:"Male",892block2_speakerGender:"Male",893block2_speakerName:"Ted",894block2_subjectGender:"Male",895block2_subjectName:"Justin",896topic:"healthcare",897predicate:"see",898complement:"the government should stay out of the healthcare system",899complementType:"abstract-should"},900 {list:"3",901id:"44",902idCondition:"44-N",903orientation:"N",904block1_speakerGender:"Male",905block1_speakerName:"Derek",906block1_subjectName:"Lisa",907block1_subjectGender:"Female",908block2_speakerGender:"Male",909block2_speakerName:"Richard",910block2_subjectGender:"Female",911block2_subjectName:"Vicky",912topic:"hot",913predicate:"realize",914complement:"it\'s too hot in the meeting room",915complementType:"abstract"},916 {list:"3",917id:"24",918idCondition:"24-R",919orientation:"R",920block1_speakerGender:"Male",921block1_speakerName:"Rob",922block1_subjectName:"Bill",923block1_subjectGender:"Male",924block2_speakerGender:"Male",925block2_speakerName:"Martin",926block2_subjectGender:"Male",927block2_subjectName:"Gabe",928topic:"immmigration",929predicate:"feel",930complement:"immigrants steal jobs from Americans",931complementType:"concrete"},932 {list:"3",933id:"45",934idCondition:"45-N",935orientation:"N",936block1_speakerGender:"Male",937block1_speakerName:"Steve",938block1_subjectName:"Alice",939block1_subjectGender:"Female",940block2_speakerGender:"Male",941block2_speakerName:"Nicholas",942block2_subjectGender:"Female",943block2_subjectName:"Jennifer",944topic:"late",945predicate:"think",946complement:"the meeting started late",947complementType:"concrete"},948 {list:"3",949id:"46",950idCondition:"46-N",951orientation:"N",952block1_speakerGender:"Male",953block1_speakerName:"Isaac",954block1_subjectName:"James",955block1_subjectGender:"Male",956block2_speakerGender:"Male",957block2_speakerName:"Greg",958block2_subjectGender:"Male",959block2_subjectName:"Tim",960topic:"long",961predicate:"feel",962complement:"the club meetings are too long",963complementType:"abstract"},964 {list:"3",965id:"25",966idCondition:"25-L",967orientation:"L",968block1_speakerGender:"Male",969block1_speakerName:"David",970block1_subjectName:"Anna",971block1_subjectGender:"Female",972block2_speakerGender:"Male",973block2_speakerName:"Aaron",974block2_subjectGender:"Female",975block2_subjectName:"Rhonda",976topic:"medicaid",977predicate:"know",978complement:"medicaid funding should be increased",979complementType:"abstract-should"},980 {list:"3",981id:"47",982idCondition:"47-N",983orientation:"N",984block1_speakerGender:"Female",985block1_speakerName:"Jessica",986block1_subjectName:"Megan",987block1_subjectGender:"Female",988block2_speakerGender:"Female",989block2_speakerName:"Amber",990block2_subjectGender:"Female",991block2_subjectName:"Mandy",992topic:"membership",993predicate:"know",994complement:"club membership numbers have increased",995complementType:"concrete"},996 {list:"3",997id:"26",998idCondition:"26-R",999orientation:"R",1000block1_speakerGender:"Female",1001block1_speakerName:"Emily",1002block1_subjectName:"Caleb",1003block1_subjectGender:"Male",1004block2_speakerGender:"Female",1005block2_speakerName:"Tina",1006block2_subjectGender:"Male",1007block2_subjectName:"Ethan",1008topic:"Obama",1009predicate:"know",1010complement:"Obama damaged the American economy",1011complementType:"concrete"},1012 {list:"3",1013id:"48",1014idCondition:"48-N",1015orientation:"N",1016block1_speakerGender:"Female",1017block1_speakerName:"Cindy",1018block1_subjectName:"Ben",1019block1_subjectGender:"Male",1020block2_speakerGender:"Female",1021block2_speakerName:"Celia",1022block2_subjectGender:"Male",1023block2_subjectName:"Peter",1024topic:"pizza",1025predicate:"discover",1026complement:"the pizza has olives on it",1027complementType:"concrete"},1028 {list:"3",1029id:"49",1030idCondition:"49-N",1031orientation:"N",1032block1_speakerGender:"Male",1033block1_speakerName:"Nathan",1034block1_subjectName:"Clara",1035block1_subjectGender:"Female",1036block2_speakerGender:"Male",1037block2_speakerName:"Bruce",1038block2_subjectGender:"Female",1039block2_subjectName:"Julie",1040topic:"recruitment",1041predicate:"believe",1042complement:"there need to be more club recruitment activities",1043complementType:"abstract-should"},1044 {list:"3",1045id:"27",1046idCondition:"27-R",1047orientation:"R",1048block1_speakerGender:"Female",1049block1_speakerName:"Linda",1050block1_subjectName:"Roger",1051block1_subjectGender:"Male",1052block2_speakerGender:"Female",1053block2_speakerName:"Charlotte",1054block2_subjectGender:"Male",1055block2_subjectName:"Brandon",1056topic:"the wall",1057predicate:"think",1058complement:"the government should fund the border wall",1059complementType:"abstract-should"},1060 {list:"3",1061id:"28",1062idCondition:"28-R",1063orientation:"R",1064block1_speakerGender:"Female",1065block1_speakerName:"Allison",1066block1_subjectName:"Laura",1067block1_subjectGender:"Female",1068block2_speakerGender:"Female",1069block2_speakerName:"Valerie",1070block2_subjectGender:"Female",1071block2_subjectName:"Alaina",1072topic:"Trump",1073predicate:"discover",1074complement:"Trump\'s national security policies make Americans safer",1075complementType:"concrete"},1076 {list:"3",1077id:"filler1",1078idCondition:"filler1",1079orientation:"NONE",1080block1_speakerGender:"Female",1081block1_speakerName:"Rita",1082block1_subjectName:"Simon",1083block1_subjectGender:"Male",1084block2_speakerGender:"Female",1085block2_speakerName:"Carly",1086block2_subjectGender:"Male",1087block2_subjectName:"Alan",1088topic:"cookies",1089predicate:"NONE",1090complement:"brought the cookies for dessert",1091complementType:"NONE"},1092 {list:"3",1093id:"filler2",1094idCondition:"filler2",1095orientation:"NONE",1096block1_speakerGender:"Male",1097block1_speakerName:"Daniel",1098block1_subjectName:"Caroline",1099block1_subjectGender:"Female",1100block2_speakerGender:"Male",1101block2_speakerName:"Larry",1102block2_subjectGender:"Female",1103block2_subjectName:"Olivia",1104topic:"sick",1105predicate:"NONE",1106complement:"missed the meeting because she\'s sick",1107complementType:"NONE"}];1108var list4 =1109[{list:"4",1110id:"15",1111idCondition:"15-L",1112orientation:"L",1113block1_speakerGender:"Female",1114block1_speakerName:"Mary",1115block1_subjectName:"Frank",1116block1_subjectGender:"Male",1117block2_speakerGender:"Female",1118block2_speakerName:"Judith",1119block2_subjectGender:"Male",1120block2_subjectName:"Gordon",1121topic:"abortion",1122predicate:"believe",1123complement:"abortion rights should be expanded",1124complementType:"abstract-should"},1125 {list:"4",1126id:"16",1127idCondition:"16-R",1128orientation:"R",1129block1_speakerGender:"Female",1130block1_speakerName:"Katie",1131block1_subjectName:"Jeff",1132block1_subjectGender:"Male",1133block2_speakerGender:"Female",1134block2_speakerName:"Jane",1135block2_subjectGender:"Male",1136block2_subjectName:"Brad",1137topic:"abortion-2",1138predicate:"think",1139complement:"abortion is unethical",1140complementType:"?"},1141 {list:"4",1142id:"17",1143idCondition:"17-R",1144orientation:"R",1145block1_speakerGender:"Female",1146block1_speakerName:"Maria",1147block1_subjectName:"Elizabeth",1148block1_subjectGender:"Female",1149block2_speakerGender:"Female",1150block2_speakerName:"Wendy",1151block2_subjectGender:"Female",1152block2_subjectName:"Natasha",1153topic:"affirmative action",1154predicate:"see",1155complement:"affirmative action programs drain government resources",1156complementType:"concrete"},1157 {list:"4",1158id:"18",1159idCondition:"18-R",1160orientation:"R",1161block1_speakerGender:"Male",1162block1_speakerName:"Noah",1163block1_subjectName:"John",1164block1_subjectGender:"Male",1165block2_speakerGender:"Male",1166block2_speakerName:"Ian",1167block2_subjectGender:"Male",1168block2_subjectName:"Clark",1169topic:"capital punishment",1170predicate:"feel",1171complement:"all states should allow capital punishment",1172complementType:"abstract"},1173 {list:"4",1174id:"50",1175idCondition:"50-N",1176orientation:"N",1177block1_speakerGender:"Male",1178block1_speakerName:"Fred",1179block1_subjectName:"Martha",1180block1_subjectGender:"Female",1181block2_speakerGender:"Male",1182block2_speakerName:"Evan",1183block2_subjectGender:"Female",1184block2_subjectName:"Andrea",1185topic:"earlier",1186predicate:"think",1187complement:"club meetings need to start earlier",1188complementType:"abstract-should"},1189 {list:"4",1190id:"19",1191idCondition:"19-R",1192orientation:"R",1193block1_speakerGender:"Female",1194block1_speakerName:"Nancy",1195block1_subjectName:"Tom",1196block1_subjectGender:"Male",1197block2_speakerGender:"Female",1198block2_speakerName:"Theresa",1199block2_subjectGender:"Male",1200block2_subjectName:"George",1201topic:"environmental laws",1202predicate:"discover",1203complement:"there are too many environmental laws",1204complementType:"abstract"},1205 {list:"4",1206id:"20",1207idCondition:"20-R",1208orientation:"R",1209block1_speakerGender:"Male",1210block1_speakerName:"Luke",1211block1_subjectName:"Andy",1212block1_subjectGender:"Male",1213block2_speakerGender:"Male",1214block2_speakerName:"Don",1215block2_subjectGender:"Male",1216block2_subjectName:"Jim",1217topic:"gay marriage",1218predicate:"realize",1219complement:"only heterosexual couples should be allowed to marry",1220complementType:"abstract-should"},1221 {list:"4",1222id:"21",1223idCondition:"21-L",1224orientation:"L",1225block1_speakerGender:"Female",1226block1_speakerName:"Rosie",1227block1_subjectName:"Lily",1228block1_subjectGender:"Female",1229block2_speakerGender:"Female",1230block2_speakerName:"Esther",1231block2_subjectGender:"Female",1232block2_subjectName:"Felicia",1233topic:"gun laws ",1234predicate:"realize",1235complement:"strict gun control laws prevent mass shootings",1236complementType:"concrete"},1237 {list:"4",1238id:"22",1239idCondition:"22-R",1240orientation:"R",1241block1_speakerGender:"Female",1242block1_speakerName:"Sandra",1243block1_subjectName:"Ashley",1244block1_subjectGender:"Female",1245block2_speakerGender:"Female",1246block2_speakerName:"Debbie",1247block2_subjectGender:"Female",1248block2_subjectName:"Kathleen",1249topic:"guns and teachers",1250predicate:"believe",1251complement:"schoolteachers carrying guns promotes student safety",1252complementType:"concrete"},1253 {list:"4",1254id:"23",1255idCondition:"23-L",1256orientation:"L",1257block1_speakerGender:"Male",1258block1_speakerName:"Brian",1259block1_subjectName:"Jake",1260block1_subjectGender:"Male",1261block2_speakerGender:"Male",1262block2_speakerName:"Ted",1263block2_subjectGender:"Male",1264block2_subjectName:"Justin",1265topic:"healthcare",1266predicate:"see",1267complement:"the government should run the healthcare system",1268complementType:"abstract-should"},1269 {list:"4",1270id:"51",1271idCondition:"51-N",1272orientation:"N",1273block1_speakerGender:"Male",1274block1_speakerName:"Derek",1275block1_subjectName:"Lisa",1276block1_subjectGender:"Female",1277block2_speakerGender:"Male",1278block2_speakerName:"Richard",1279block2_subjectGender:"Female",1280block2_subjectName:"Vicky",1281topic:"hot",1282predicate:"feel",1283complement:"it\'s too hot in the meeting room",1284complementType:"abstract"},1285 {list:"4",1286id:"24",1287idCondition:"24-L",1288orientation:"L",1289block1_speakerGender:"Male",1290block1_speakerName:"Rob",1291block1_subjectName:"Bill",1292block1_subjectGender:"Male",1293block2_speakerGender:"Male",1294block2_speakerName:"Martin",1295block2_subjectGender:"Male",1296block2_subjectName:"Gabe",1297topic:"immmigration",1298predicate:"feel",1299complement:"immigrants support the American economy",1300complementType:"concrete"},1301 {list:"4",1302id:"52",1303idCondition:"52-N",1304orientation:"N",1305block1_speakerGender:"Male",1306block1_speakerName:"Steve",1307block1_subjectName:"Alice",1308block1_subjectGender:"Female",1309block2_speakerGender:"Male",1310block2_speakerName:"Nicholas",1311block2_subjectGender:"Female",1312block2_subjectName:"Jennifer",1313topic:"late",1314predicate:"realize",1315complement:"the meeting started late",1316complementType:"concrete"},1317 {list:"4",1318id:"53",1319idCondition:"53-N",1320orientation:"N",1321block1_speakerGender:"Male",1322block1_speakerName:"Isaac",1323block1_subjectName:"James",1324block1_subjectGender:"Male",1325block2_speakerGender:"Male",1326block2_speakerName:"Greg",1327block2_subjectGender:"Male",1328block2_subjectName:"Tim",1329topic:"long",1330predicate:"see",1331complement:"the club meetings are too long",1332complementType:"abstract"},1333 {list:"4",1334id:"25",1335idCondition:"25-R",1336orientation:"R",1337block1_speakerGender:"Male",1338block1_speakerName:"David",1339block1_subjectName:"Anna",1340block1_subjectGender:"Female",1341block2_speakerGender:"Male",1342block2_speakerName:"Aaron",1343block2_subjectGender:"Female",1344block2_subjectName:"Rhonda",1345topic:"medicaid",1346predicate:"know",1347complement:"medicaid funding should be decreased",1348complementType:"abstract-should"},1349 {list:"4",1350id:"54",1351idCondition:"54-N",1352orientation:"N",1353block1_speakerGender:"Female",1354block1_speakerName:"Jessica",1355block1_subjectName:"Megan",1356block1_subjectGender:"Female",1357block2_speakerGender:"Female",1358block2_speakerName:"Amber",1359block2_subjectGender:"Female",1360block2_subjectName:"Mandy",1361topic:"membership",1362predicate:"believe",1363complement:"club membership numbers have increased",1364complementType:"concrete"},1365 {list:"4",1366id:"26",1367idCondition:"26-L",1368orientation:"L",1369block1_speakerGender:"Female",1370block1_speakerName:"Emily",1371block1_subjectName:"Caleb",1372block1_subjectGender:"Male",1373block2_speakerGender:"Female",1374block2_speakerName:"Tina",1375block2_subjectGender:"Male",1376block2_subjectName:"Ethan",1377topic:"Obama",1378predicate:"know",1379complement:"Obama improved the American economy",1380complementType:"concrete"},1381 {list:"4",1382id:"55",1383idCondition:"55-N",1384orientation:"N",1385block1_speakerGender:"Female",1386block1_speakerName:"Cindy",1387block1_subjectName:"Ben",1388block1_subjectGender:"Male",1389block2_speakerGender:"Female",1390block2_speakerName:"Celia",1391block2_subjectGender:"Male",1392block2_subjectName:"Peter",1393topic:"pizza",1394predicate:"know",1395complement:"the pizza has olives on it",1396complementType:"concrete"},1397 {list:"4",1398id:"56",1399idCondition:"56-N",1400orientation:"N",1401block1_speakerGender:"Male",1402block1_speakerName:"Nathan",1403block1_subjectName:"Clara",1404block1_subjectGender:"Female",1405block2_speakerGender:"Male",1406block2_speakerName:"Bruce",1407block2_subjectGender:"Female",1408block2_subjectName:"Julie",1409topic:"recruitment",1410predicate:"discover",1411complement:"there need to be more club recruitment activities",1412complementType:"abstract-should"},1413 {list:"4",1414id:"27",1415idCondition:"27-L",1416orientation:"L",1417block1_speakerGender:"Female",1418block1_speakerName:"Linda",1419block1_subjectName:"Roger",1420block1_subjectGender:"Male",1421block2_speakerGender:"Female",1422block2_speakerName:"Charlotte",1423block2_subjectGender:"Male",1424block2_subjectName:"Brandon",1425topic:"the wall",1426predicate:"think",1427complement:"the government should refuse to fund the border wall",1428complementType:"abstract-should"},1429 {list:"4",1430id:"28",1431idCondition:"28-L",1432orientation:"L",1433block1_speakerGender:"Female",1434block1_speakerName:"Allison",1435block1_subjectName:"Laura",1436block1_subjectGender:"Female",1437block2_speakerGender:"Female",1438block2_speakerName:"Valerie",1439block2_subjectGender:"Female",1440block2_subjectName:"Alaina",1441topic:"Trump",1442predicate:"discover",1443complement:"Trump\'s national security policies put Americans in danger",1444complementType:"concrete"},1445 {list:"4",1446id:"filler1",1447idCondition:"filler1",1448orientation:"NONE",1449block1_speakerGender:"Female",1450block1_speakerName:"Rita",1451block1_subjectName:"Simon",1452block1_subjectGender:"Male",1453block2_speakerGender:"Female",1454block2_speakerName:"Carly",1455block2_subjectGender:"Male",1456block2_subjectName:"Alan",1457topic:"cookies",1458predicate:"NONE",1459complement:"brought the cookies for dessert",1460complementType:"NONE"},1461 {list:"4",1462id:"filler2",1463idCondition:"filler2",1464orientation:"NONE",1465block1_speakerGender:"Male",1466block1_speakerName:"Daniel",1467block1_subjectName:"Caroline",1468block1_subjectGender:"Female",1469block2_speakerGender:"Male",1470block2_speakerName:"Larry",1471block2_subjectGender:"Female",1472block2_subjectName:"Olivia",1473topic:"sick",1474predicate:"NONE",1475complement:"missed the meeting because she\'s sick",...

Full Screen

Full Screen

objectUpdate.js

Source:objectUpdate.js Github

copy

Full Screen

1// Update blocks acceleration2// Update position of Block 1 & 2 and angle of Pulley3// according to motion phase4// And detect for collision between Block 2 and Stopper5function objectUpdate() {6 // Update time7 dt = animSpeedSlider.value() / fps;8 t += dt;9 // --------------------------------------------------------------------------10 // Tests to determine static/kinetic motion and if stopper has been reached11 // --------------------------------------------------------------------------12 // Test static hypothesis13 if (staticTest == "on") {14 let fsmax = mus.value() * block1.mass * g;15 if (block2.mass * g <= fsmax) {16 motionState = "static";17 } else {18 motionState = "kinetic";19 }20 staticTest = "off";21 }22 // Test if stopper has been reached23 if (block2.pos.y <= stopper.pos.y + block2.height / 2 + stopper.height) {24 stopperState = "on";25 } else {26 stopperState = "off";27 }28 // --------------------------------------------------------------------------29 // Update forces magnitudes and accelerations30 // --------------------------------------------------------------------------31 Fg1.dir.set(0, -block1.mass * g);32 n1.dir.set(0, block1.mass * g);33 Fg2.dir.set(0, -block2.mass * g);34 switch (motionState) {35 case "static":36 if (stopperState == "off") {37 // No normal on block 238 n2.dir.set(0, 0);39 // T1 = T2 = fsc = Fg240 T1b.dir.set(-Fg2.dir.mag(), 0);41 T1p.dir.set(+Fg2.dir.mag(), 0);42 T2b.dir.set(0, +Fg2.dir.mag());43 T2p.dir.set(0, -Fg2.dir.mag());44 fsc.dir.set(+Fg2.dir.mag(), 0);45 } else if (stopperState == "on") {46 // Normal on block 247 n2.dir.set(0, Fg2.dir.mag());48 // T1 = T2 = fsc = 049 T1b.dir.set(0, 0);50 T1p.dir.set(0, 0);51 T2b.dir.set(0, 0);52 T2p.dir.set(0, 0);53 fsc.dir.set(0, 0);54 }55 block1.acc.set(0, 0);56 block2.acc.set(0, 0);57 break;58 case "kinetic":59 if (stopperState == "off") {60 // No normal on block 261 n2.dir.set(0, 0);62 // T1, T2, fsc63 let mucNum = parseFloat(muc.value());64 let T1 =65 (block1.mass *66 block2.mass *67 g *68 (1 + mucNum + (mucNum * pulley.mass) / (2 + block2.mass))) /69 (block1.mass + block2.mass + pulley.mass / 2);70 let T2 =71 (block1.mass *72 block2.mass *73 g *74 (1 + mucNum + pulley.mass / 2 / block1.mass)) /75 (block1.mass + block2.mass + pulley.mass / 2);76 T1b.dir.set(-T1, 0);77 T1p.dir.set(+T1, 0);78 T2b.dir.set(0, +T2);79 T2p.dir.set(0, -T2);80 fsc.dir.set(mucNum * block1.mass * g, 0);81 block1.acc.set((T1b.dir.x + fsc.dir.x) / block1.mass, 0);82 block2.acc.set(0, (T2b.dir.y + Fg2.dir.y) / block2.mass);83 } else if (stopperState == "on") {84 // Normal on block 285 n2.dir.set(0, block2.mass * g);86 // T1 = T2 = fsc = 087 T1b.dir.set(0, 0);88 T1p.dir.set(0, 0);89 T2b.dir.set(0, 0);90 T2p.dir.set(0, 0);91 let mucNum = parseFloat(muc.value());92 fsc.dir.set(mucNum * block1.mass * g, 0);93 block1.acc.set(fsc.dir.x / block1.mass, 0);94 block2.acc.set(0, (n2.dir.y - block2.mass * g) / block2.mass);95 }96 break;97 }98 // --------------------------------------------------------------------------99 // Update plots100 // --------------------------------------------------------------------------101 // Acceleration plot102 label =103 t.toFixed(2).toString() +104 "s" +105 ", " +106 -block1.acc.x.toFixed(2).toString() +107 "m/s^2";108 plotAcc.points.push(new GPoint(t, -block1.acc.x.toFixed(4), label));109 // Velocity plot block 1110 label =111 t.toFixed(2).toString() +112 "s" +113 ", " +114 -block1.vel.x.toFixed(2).toString() +115 "m/s";116 plotVel.points.push(new GPoint(t, -block1.vel.x.toFixed(4), label));117 // Position plot block 1118 label =119 t.toFixed(2).toString() +120 "s" +121 ", " +122 -(block1.pos.x - block1.posInit.x).toFixed(2).toString() +123 "m";124 plotPos.points.push(125 new GPoint(t, -(block1.pos.x - block1.posInit.x).toFixed(4), label)126 );127 // --------------------------------------------------------------------------128 // Update positions and velocities of block 1, 2 and the pulley129 // --------------------------------------------------------------------------130 // Update block 1, 2 and pulley positions and velocities131 // test if Block 1 has reached the left end (which means end of movement)132 let block1XLimit = pulley.pos.x + block1.width / 2 + 1.5 * pulley.radius;133 if (block1.pos.x >= block1XLimit) {134 block1.pos0 = block1.pos;135 block1.vel0 = block1.vel;136 block1.pos.set(137 block1.pos0.x + block1.vel0.x * dt + 0.5 * block1.acc.x * dt * dt,138 block1.pos0.y + block1.vel0.y * dt + 0.5 * block1.acc.y * dt * dt139 );140 block1.vel.set(141 block1.vel0.x + block1.acc.x * dt,142 block1.vel0.y + block1.acc.y * dt143 );144 pulley.angle0 = pulley.angle;145 pulley.angle =146 pulley.angle0 +147 (block1.vel.x / pulley.radius) * dt +148 ((0.5 * block1.acc.x) / pulley.radius) * dt * dt;149 } else {150 block1.pos.x = block1XLimit;151 block1.vel.x = 0;152 simPhase = "pause";153 }154 // Test if Block 1 velocity has reach zero155 if (block1.vel.x >= 0) {156 block1.vel.x = 0;157 simPhase = "pause";158 }159 // Test if Block 2 has reached the stopper160 if (stopperState == "off") {161 block2.pos0 = block2.pos;162 block2.vel0 = block2.vel;163 block2.pos.set(164 block2.pos0.x + block2.vel0.x * dt + 0.5 * block2.acc.x * dt * dt,165 block2.pos0.y + block2.vel0.y * dt + 0.5 * block2.acc.y * dt * dt166 );167 block2.vel.set(168 block2.vel0.x + block2.acc.x * dt,169 block2.vel0.y + block2.acc.y * dt170 );171 } else if (stopperState == "on") {172 block2.pos.y = stopper.pos.y + block2.height / 2 + stopper.height;173 block2.vel.y = 0;174 }175 // --------------------------------------------------------------------------176 // Update forces positions177 // --------------------------------------------------------------------------178 Fg1.pos.set(block1.pos.x, block1.pos.y);179 n1.pos.set(block1.pos.x, block1.pos.y);180 Fg2.pos.set(block2.pos.x, block2.pos.y);181 n2.pos.set(block2.pos.x, block2.pos.y);182 T1b.pos.set(block1.pos.x, block1.pos.y);183 T1p.pos.set(pulley.pos.x, pulley.pos.y + pulley.radius);184 T2b.pos.set(block2.pos.x, block2.pos.y);185 T2p.pos.set(pulley.pos.x - pulley.radius, pulley.pos.y);186 fsc.pos.set(block1.pos.x, block1.pos.y);...

Full Screen

Full Screen

BlockListener.js

Source:BlockListener.js Github

copy

Full Screen

1//Block listener.2var BlockListener = function(game){3 this.currentGame = game;4};5BlockListener.prototype.begin = function(arbiter, space){6 7 var block1 = null;8 var block2 = null;9 10 if(arbiter.body_a.userdata != null && arbiter.body_a.userdata.type == Enum.UserData.Type.BLOCK)11 block1 = arbiter.body_a.userdata.object;12 if(arbiter.body_b.userdata != null && arbiter.body_b.userdata.type == Enum.UserData.Type.BLOCK)13 block2 = arbiter.body_b.userdata.object;14 15 //Resolve skill.16 if(block1 != null && block1.type == Enum.Block.Type.SKILLED && block1.skill != null)17 this.resolve(block1, arbiter.body_b.userdata);18 19 if(block2 != null && block2.type == Enum.Block.Type.SKILLED && block2.skill != null)20 this.resolve(block2, arbiter.body_a.userdata);21 //Special process for collision with two blocks.22 if(block1 != null && block2 != null)23 { 24 //Some skills need a target defined when touching a block.25 if(block1.skill && block1.skill.targetWithBlock)26 block1.linkedBlockId = block2.id;27 28 if(block2.skill && block2.skill.targetWithBlock)29 block2.linkedBlockId = block1.id;30 31 if(block1.type == Enum.Block.Type.COLORED && block2.type == Enum.Block.Type.COLORED32 && block1.color == block2.color && block1.color < Enum.Color.GREEN)33 { 34 //Check if linked block has been destroyed first.35 if(block1.linkedBlockId != null && this.currentGame.blocks[block1.linkedBlockId] == null)36 block1.linkedBlockId = null;37 if(block2.linkedBlockId != null && this.currentGame.blocks[block2.linkedBlockId] == null)38 block2.linkedBlockId = null;39 40 //If blocks are touching a third one, destroy them all.41 if((block1.linkedBlockId != null && block1.linkedBlockId != block2.id) 42 || (block2.linkedBlockId != null && block2.linkedBlockId != block1.id))43 {44 block1.markToDestroy(Enum.Block.Destruction.COLOR_CONTACT);45 block2.markToDestroy(Enum.Block.Destruction.COLOR_CONTACT);46 47 //Destroy linked leaves.48 if(block1.linkedBlockId != null)49 this.destroyLeaves(block1.linkedBlockId, block1.id);50 if(block2.linkedBlockId != null)51 this.destroyLeaves(block2.linkedBlockId, block2.id);52 53 block1 = null;54 block2 = null;55 }56 else57 {58 block1.linkedBlockId = block2.id;59 block2.linkedBlockId = block1.id;60 }61 }62 else if(block1.type == Enum.Block.Type.COLORED && block2.type == Enum.Block.Type.COLORED 63 && Math.abs(block1.color - block2.color) == 4)64 {65 //Destroy complementary blocks on contact.66 block1.markToDestroy(Enum.Block.Destruction.COLOR_CONTACT);67 block2.markToDestroy(Enum.Block.Destruction.COLOR_CONTACT);68 69 block1 = null;70 block2 = null;71 }72 }73 74 //Treament for player within contact.75 var player = null;76 77 if(block1 == null && arbiter.body_a.userdata != null && arbiter.body_a.userdata.type == Enum.UserData.Type.PLAYER)78 player = arbiter.body_a.userdata.object;79 if(block2 == null && arbiter.body_b.userdata != null && arbiter.body_b.userdata.type == Enum.UserData.Type.PLAYER)80 player = arbiter.body_b.userdata.object;81 82 //Trigger spawn.83 if(block1 != null && player == null && block1.type == Enum.Block.Type.SPAWN)84 block1.mustTrigger = true;85 if(block2 != null && player == null && block2.type == Enum.Block.Type.SPAWN)86 block2.mustTrigger = true;87 88 if(player != null)89 {90 var killingBlock = (block1 != null ? block1 : block2);91 92 if(killingBlock != null && !killingBlock.landed && (!killingBlock.owner || killingBlock.owner.id != player.id))93 {94 if(killingBlock.owner == null)95 {96 this.currentGame.overlord.kill(player, killingBlock.type);97 }98 else99 {100 //Mark the player to be inserted in the next update in the killer blocks list.101 killingBlock.owner.kill(player, killingBlock.type);102 }103 }104 105 block1 = null;106 block2 = null;107 }108 //Check if blocks land.109 if(block1 != null && !block1.isStatic && (block1.launchLandTimer <= 0 || !block2))110 {111 //State can't be changed during callback.112 block1.toggleState = true;113 block1.isStatic = true;114 block1.justLanded = true;115 block1.landingTimer = Constants.Block.LANDING_TIMER;116 }117 118 if(block2 != null && !block2.isStatic && (block2.launchLandTimer <= 0 || !block1))119 {120 block2.toggleState = true;121 block2.isStatic = true;122 block2.justLanded = true;123 block2.landingTimer = Constants.Block.LANDING_TIMER;124 }125};126 127BlockListener.prototype.resolve = function(skillBlock, otherUserdata){128 129 switch(skillBlock.skill.trigger){130 case Enum.Block.Skill.Trigger.ON_LANDING:131 132 if(otherUserdata != null && otherUserdata.type == Enum.UserData.Type.PLAYER)133 return;134 135 skillBlock.mustTrigger = true;136 137 break;138 }139};140 141BlockListener.prototype.destroyLeaves = function(blockId, previousId){142 143 var block = this.currentGame.blocks[blockId];144 145 if(block != null)146 {147 block.markToDestroy(Enum.Block.Destruction.COLOR_CONTACT);148 149 if(block.linkedBlockId != null && block.linkedBlockId != previousId)150 this.destroyLeaves(block.linkedBlockId, blockId);151 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { block2 } from 'ng-mocks';2import { MyComponent } from './my.component';3describe('MyComponent', () => {4 it('should render', () => {5 const fixture = block2(MyComponent);6 expect(fixture).toBeDefined();7 });8});9import { Component } from '@angular/core';10@Component({11})12export class MyComponent {13}14import { MyComponent } from './my.component';15describe('MyComponent', () => {16 it('should render', () => {17 const fixture = block2(MyComponent);18 expect(fixture).toBeDefined();19 });20});21import { MyComponent } from './my.component';22describe('MyComponent', () => {23 it('should render', () => {24 const fixture = block2(MyComponent);25 expect(fixture).toBeDefined();26 });27});28import { MyComponent } from './my.component';29describe('MyComponent', () => {30 it('should render', () => {31 const fixture = block2(MyComponent);32 expect(fixture).toBeDefined();33 });34});35import { MyComponent } from './my.component';36describe('MyComponent', () => {37 it('should render', () => {38 const fixture = block2(MyComponent);39 expect(fixture).toBeDefined();40 });41});42import { MyComponent } from './my.component';43describe('MyComponent', () => {44 it('should render', () => {45 const fixture = block2(MyComponent);46 expect(fixture).toBeDefined();47 });48});49import { MyComponent } from './my.component';50describe('MyComponent', () => {51 it('should render', () => {52 const fixture = block2(MyComponent);53 expect(fixture).toBeDefined();54 });55});56import { MyComponent } from './my.component';57describe('MyComponent', () => {58 it('should render', () => {59 const fixture = block2(MyComponent);60 expect(fixture).toBeDefined();61 });62});63import { MyComponent } from './my.component';64describe('MyComponent', () => {65 it('should render', ()

Full Screen

Using AI Code Generation

copy

Full Screen

1import { block2 } from 'ng-mocks';2import { MyComponent } from './my.component';3import { MyModule } from './my.module';4const fixture = block2(MyModule, MyComponent);5import { block2 } from 'ng-mocks';6import { MyComponent } from './my.component';7import { MyModule } from './my.module';8const fixture = block2(MyModule, MyComponent);9import { block2 } from 'ng-mocks';10import { MyComponent } from './my.component';11import { MyModule } from './my.module';12const fixture = block2(MyModule, MyComponent);13import { block2 } from 'ng-mocks';14import { MyComponent } from './my.component';15import { MyModule } from './my.module';16const fixture = block2(MyModule, MyComponent);17import { block2 } from 'ng-mocks';18import { MyComponent } from './my.component';19import { MyModule } from './my.module';20const fixture = block2(MyModule, MyComponent);21import { block2 } from 'ng-mocks';22import { MyComponent } from './my.component';23import { MyModule } from './my.module';24const fixture = block2(MyModule, MyComponent);25import { block2 } from 'ng-mocks';26import { MyComponent } from './my.component';27import { MyModule } from './my.module';28const fixture = block2(MyModule, MyComponent);29import { block2 } from 'ng-mocks';30import { MyComponent } from './my.component';31import { MyModule } from './my.module';32const fixture = block2(MyModule, MyComponent);33import { block2 } from 'ng-mocks';34import { MyComponent } from './my.component';35import { MyModule } from './my.module';36const fixture = block2(MyModule, MyComponent);37import { block2 } from 'ng-mocks';38import {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { block2 } from 'ng-mocks';2import { MyComponent } from './my.component';3import { MyModule } from './my.module';4const fixture = block2(MyComponent, MyModule);5import { block2 } from 'ng-mocks';6import { MyComponent } from './my.component';7import { MyModule } from './my.module';8const fixture = block2(MyComponent, MyModule);9import { block2 } from 'ng-mocks';10import { MyComponent } from './my.component';11import { MyModule } from './my.module';12const fixture = block2(MyComponent, MyModule);13import { block2 } from 'ng-mocks';14import { MyComponent } from './my.component';15import { MyModule } from './my.module';16const fixture = block2(MyComponent, MyModule);17import { block2 } from 'ng-mocks';18import { MyComponent } from './my.component';19import { MyModule } from './my.module';20const fixture = block2(MyComponent, MyModule);21import { block2 } from 'ng-mocks';22import { MyComponent } from './my.component';23import { MyModule } from './my.module';24const fixture = block2(MyComponent, MyModule);25import { block2 } from 'ng-mocks';26import { MyComponent } from './my.component';27import { MyModule } from './my.module';28const fixture = block2(MyComponent, MyModule);29import { block2 } from 'ng-mocks';30import { MyComponent } from './my.component';31import { MyModule } from './my.module';32const fixture = block2(MyComponent, MyModule);33import { block2 } from 'ng-mocks';34import { MyComponent } from './my.component';35import { MyModule } from './my.module';36const fixture = block2(MyComponent, MyModule);37import { block2 } from 'ng-mocks';38import {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { block2 } from 'ng-mocks';2describe('test', () => {3 it('should work', () => {4 const fixture = block2('<div>hello</div>');5 expect(fixture.nativeElement.innerHTML).toEqual('hello');6 });7});8import { block2 } from 'ng-mocks';9describe('test', () => {10 it('should work', () => {11 const fixture = block2('<div>hello</div>');12 expect(fixture.nativeElement.innerHTML).toEqual('hello');13 });14});15Module build failed (from ./node_modules/babel-loader/lib/index.js):16SyntaxError: test.js: Unexpected token, expected "," (2:6)17> 2 | import { block2 } from 'ng-mocks';18 4 | describe('test', () => {19 5 | it('should work', () => {20The problem is that the import statement is not transpiled to ES5. I am using the following babel configuration:21{22 {23 "targets": {24 }25 }26}27{28 {29 "targets": {30 }31 }32}33module.exports = function(api) {34 api.cache(true);35 {36 "targets": {37 }38 }39 ];

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful