代写辅导接单-FIT2102

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

FIT2102ProgrammingParadigms

2024

Assignment1:FunctionalReactiveProgramming

DueDate:Friday,30August2024,11:55PM

Weighting:30%ofyourfinalmarkfortheunit

Interview:DuringWeek7

Overview:StudentswillworkindependentlytocreateagameusingFunctional

ReactiveProgramming(FRP)techniques.Programswillbeimplementedin

TypeScriptanduseRxJSObservablestreamstohandleanimation,userinteraction,

andothersimilarstreambehaviours.Thegoalistodemonstrateagood

understandingoffunctionalprogrammingtechniquesasexploredinthefirst

fiveweeksoftheunit,includingwrittendocumentationofthedesigndecisionsand

features.

Submissioninstructions

Submitazippedfilenamed_.zipwhichextractstoa

foldernamed_

●Itmustcontainallthecodeforyourprogramalongwithallthesupporting

filesaswellasthereport.

●Itshouldincludesufficientdocumentationthatwecanappreciateeverything

youhavedone.

●Youalsoneedtoincludeareportdescribingyourdesigndecisions.

●TheonlyexternallibraryshouldbeRxJSlibrariessuppliedwiththestarter

code.

●Makesurethecodeyousubmitexecutesproperly.

●Donotsubmitthenode_modulesordistfolders.

Themarkingprocesswilllooksomethinglikethis:

1.Extract_.zip

2.Navigateintothefoldernamed_

3.Execute

npminstall

and

npmrundev

4.Open

http://localhost:5173

inabrowser

Pleaseensurethatyoutestthisprocessbeforesubmitting.Anyissuesduring

thisprocesswillmakeyourmarkerunhappy,andmayresultinadeductioninmarks.

Latesubmissionswillbepenalisedat5%percalendarday,roundedup.Late

submissionsmorethansevendayswillreceivezeromarksandnofeedback.

GitInstructions

WewillbeusingGitfortheassignment,however,thiswillmostlybeselfdirected.

Therearenorequirementsonhowmanycommitsyouneedtotherepo.However,

wedorecommendfollowinggoodpractices,andhavingfrequentcommitswith

meaningfulcommitmessages.Ifanyissuesarisewithacademicintegrityor

submission,thiswillbeusedasevidenceifyouhavecompletedyourownworkon

time,ifyouhavenocommits,thiswilllikelymakeitharderforyoutoclearyourselfof

anypossibleacademicintegrityissues,sowehighlyrecommendyoufollowgood

practices.

Theassignmentuploadedtomoodle,willbeusedformarking,unlessthereare

exceptionalcircumstanceswhichpreventedyoufromuploadingtomoodle,atwhich

point,wewillbemarkingthelastversioncommittedtoGitbeforetheduedate.

TheinstructionsforthesetuparepostedonEd,andfollowthemtosetuptherepo

andaccesstheskeletoncode.

TableofContents

Assignment1:FunctionalReactiveProgramming1

Submissioninstructions1

TableofContents2

Taskdescription3

Requirements4

Minimumrequirements4

FullGamerequirements4

Additionalrequirements5

Report5

Plagiarism6

AIstatement6

AdditionalInformation:MarkingCriteriaandSuggestions7

Marking(30markstotal)7

Report(4marks)8

FunctionalProgrammingstyle(8marks)8

CodeQuality(8marks)9

ObservableandRxJSusage(8marks)9

GameFeatures(2marks)10

Rubric11

Markingbands(summaryofmarkingguide)12

Markingguide13

HowtogetanHDorHighHD16

Tipsandsuggestions17

Changelog18

Taskdescription

Inthisassignment,wewillusetheRxJSObservablestreamexploredfromWeek3

tocreatetheclassicGuitarHerogameinanSVGcanvas.Youwillbeprovidedwith

astartercodebundlesimilartotheappliedsessions,includinginstructionsonusage.

TheimageaboveandtheWikipediapagearemeanttogiveyouanideaofthe

gameplay,butyoursneedn’tlookthesameorworkinpreciselythesameway,

especiallywithregardtographics.Notethatonlyasubsetofthefeatures

discussedinthelinkwillbepartoftherequirements.

Youwillalsoneedtowriteareport,asdescribedbelow.

Requirements

Thegamemustbeimplementedinagoodfunctionalreactiveprogramming

styletogetmarks.Asubsetofthegame’sfeatureswillberequiredtogetapassing

grade.Agreatersubsetoffeatureswillberequiredtogetahighergrade.Toachieve

themaximummarksforthisassignment,youwillhavetousealittlecreativityand

addsomenon-trivialfunctionalityofyourownchoice.

Minimumrequirements

Alloftheserequirementsmustbereasonablyexecutedtoachieveapassinggrade

-Agameboardwithfourcolumns

-Circlesappearfromthetopoftheboardandmovedowninacontinuous

manner,whereeachcirclealignswithamusicnote.

-Notescanbeplayedbyusingkeysforeachnotewhenthecirclesalignwith

thebottomrow.

○Youcanuseanykeysyouwantto,butthismustbedocumented

somewhereeasytofindforyourmarker.

-Notesarereadfromthefileprovidedasinputtothemainfunction(seeNote

Specificationforspecification)

-ThetimingofthenotesmustalignwiththegivenCSVfile.

-Thenotesnotforthecurrentinstrument,willneedtobeplayedinthe

background(i.e.,withoutbeingdisplayedonthegameboard)atthecorrect

time.

-Notesdemonstratereasonablebehaviour

○Appearheuristically(asimpleheuristicwillsuffice)acrossallfour

columns

○Notesdisappearwhentheyhavebeenplayed

-Eachnoteisplayedforthecorrectdurationinwhichtheyareplayed.

○Ifthekeypress,doesnotcorrectlyalignwithanote,itwillbeplayedfor

arandomdurationbetween0and0.5s

-Eachtimeakeyispressed

○Thecorrectnotemustbeplayedifthecirclesalignwiththebottomrow

○Otherwise,arandomnoteisplayed.

-Scoresmustbekepttrackduringthegame,forbothhittingandmissingnotes.

-Thegameshouldendwhenthesongfinishesplaying.

-Ashort1-2pagePDFreportdetailingyourdesigndecisionsanduseof

functionalprogrammingtechniquesdiscussedinthecoursenotes

FullGamerequirements

Meetsminimumrequirementsandhasadditionalfeatures

-Ifthenoteislongerthanonesecond,thenotesmusthavetails,wherethetail

representsthelengthofthenote.

-Theusermustholddownthecorrectkeyforthelengthofthetailtoensureit

is‘correctly’played

○Thescorewillupdate,iffthenoteisplayedforthecorrectduration

○Iftheplayerletsgoofthekeytooearly,thenotestopsplaying

-Ascoremultipliermustbeincluded,startingat1xandincreasingby0.2for

every10consecutivenoteshit(e.g.,10notes=1.2x,20notes=1.4x),and

resettingto1xwhenanoteismissed.

-Smoothandusablegameplay.

-Seevideoforanideaofappropriategameplay.Note:Thisisnotafull

implementationbutismeanttoshowcasewhatagamemightlooklike.

Additionalrequirements

SeetheAdditionalInformationandHowtogetaHighHDsections.

Report

Yourreportshouldbe300–600wordsinlength,plusupto200wordsforeach

significantadditionalfeature,whereyoushould:

-Includebasicreportformattingheadings/paragraphsanddiagramsas

necessary

-Summarisetheworkingsofthecodeandhighlighttheinterestingparts

(don’tjustdescribewhatthecodedoes,wecanreadthesourcecode!)

-Giveahighleveloverviewofyourdesigndecisionsandjustification

-ExplainhowthecodefollowsFRPstyleandinterestingusageofObservable

-Howstateismanagedthroughoutthegamewhilemaintainingpurityand

why

-DescribetheusageofObservablebeyondsimpleinputandwhy

-Important:Needtoexplainwhyyoudidthings

-Donotincludescreenshotsofcodeunlessyouhaveanexceptional

reason

-Thisshouldbeconciseandstraightforward,youmayusedotpoints

Yourmarkerwillbeinstructedtostopreadingifyourreportistoolong,and

onlymarkthefirst600(+200perfeature)words.

Plagiarism

Wewillbecheckingyourcodeagainsttherestoftheclassandtheinternetusinga

plagiarismchecker.Monashappliesstrictpenaltiestostudentswhoarefoundto

havecommittedplagiarism.Additionally,wewillbeconductinganinterview,which

givesyouachancetoexplainyourcodeandhelpusunderstandyourcodebetter.

Aslongasyouwroteyourowncode,thereisnothingtoworryaboutduringthe

interviewprocess.

AIstatement

AspertheAIstatementonMoodle,useofgenerativeAIinthisunitisunrestricted.

However,allcodegeneratedwithAImustbeproperlycitedintheformofcode

commentsstatingwhathasbeengeneratedandthescopeofitsuse.Youmustbe

abletodemonstrateunderstandingofallcodesubmittedaspartofyourassignment,

inabilitytoexplainanysubmittedcodemayresultinanacademicintegritycase.

DefinitionofaNote

Therearetwotypesofnotes:

1.

user_played==True

:Thisisthenotewhichwillbeplayedbytheuserduring

thegame.

●VisualRepresentation:

○Appearance:Inthegame,notesarerepresentedascoloured

circlesthattraveldownthescreen.Eachnotewillbeina

column,however,thecolumndoesnotneedtohaveone-to-one

mappingwithanindividualpitchvalue.

○Columns:Thegamescreenisdividedintofourcolumns,each

associatedwithadifferentbuttonorkey.

●MusicalCorrespondence:

○SoundTrigger:Whenanotereachesthedesignatedrowatthe

bottomofthescreen,theplayermustpressthecorresponding

buttonorkey.Ifdonecorrectlyandintime,thisaction"plays"the

note,meaningittriggerstheassociatedmusicalsound.

○Timing:Thetimingofpressingthebuttonorkeyiscrucial.The

gametypicallyratestheaccuracyoftheplayer'stiming,which

affectsthescoreandthequalityoftheperformance.

2.

user_played==False

:Thenotewillbeplayedbyyourcode,butwillnotbe

showntotheuserinthegame,butplayedusingthemusiclibrary.

NoteSpecificationCSV

Eachnoteisspecifiedbyfivecolumns:user_played,instrument_name,velocity,

pitch

,

start(s)

,

end(s)

.

●Ifthe

user_played

columnis

True

,thisnoteshouldappearinthegame,

otherwise,thenoteshouldbeplayedinthebackground.

●The

instrument_name

willbetheinstrumentforwhichthenoteshouldbe

playedinfromthesamplelibrary

●The

velocity

ofthenoterepresentsthevolume,between0and127.Note:

theAPIrequiresthistobeintherange[0,1]

●The

pitch

ofthenote.

start(s)

:starttimeinseconds,whichiswhenthenoteshouldbeplayed

end(s)

:endtimeinseconds,whichiswhenthenoteshouldbestopped.

Howtoplayanote:

Toplayanote,youcanusethegiven

samples

dictionary.Thisisalreadysetupin

theskeletoncodeandisunlikelytobechanged.EachinstrumentfromtheCSV,can

beusedasthekeyinthedictionary.Youcanusethe

triggerAttackRelease

function.Thistakesfourarguments:

1.

Thetonetoplay,whichcanbespecifiedusingthe

pitch

fromtheCSV

2.Thedurationofthenoteinseconds

3.

Thestarttime,setto

undefined

,tostartplayingthenoteinstantly.

4.Thevolumeofthenote,whichcorrespondstothevelocity,intherange[0,1]

Anexampleofplayingnotesisshowninthegiven

midi_example.ts

file,whichyou

canreferto,butisalsoprovidedbelow.

samples[instrument_name].triggerAttackRelease(

Tone.Frequency(pitch,"midi").toNote(),//ConvertMIDInoteto

frequency

1,//Durationofthenoteinseconds

undefined,//Usedefaulttimefornoteonset

velocity,//Setvolume

);

AdditionalInformation:MarkingCriteriaand

Suggestions

Thissectionisnotessentialforcompletingtheassignment,andisprovidedpurely

forcontextandadditionalinformationtoanswercommonquestionsstudentsmay

have.

Marking(30markstotal)

ThegoalofthisassignmentistoassessyourunderstandingofFRPandFunctional

Programming.Themarkinghasthreebroadsections:

1.Implementationofgamefeatures

2.Usageandunderstandingofproperfunctionalprogrammingstyle

3.UsageandunderstandingofRxJSandObservable

Itisimportanttorealisethat:

●ToreceiveaPassgradebyimplementingtheMinimumrequirements,

demonstratingapplicationoffunctionalprogrammingideasfromourlectures

andappliedsessions.

○YoucanreceiveuptoaDistinctionforperfectlyimplementingthe

Minimumrequirementsanddemonstratinganexcellent

understandingofhowtouseObservabletowriteclean,clearfunctional

UIcode.

●ToachieveaHighDistinction,youwillneedtoimplementtheFullgame

requirements

●Toachievethemaximumpossiblemarks,youwillneedtoimplementthefull

gamerequirementsplussomeaspectofadditionalfunctionality,as

describedbelow.

Notethatitisessentialtofollowthesubmissioninstructions,asdeductions

maybeappliedforfailingtofollowthesubmissioninstructions.

Wewillmark5sections–Report,FunctionalProgrammingstyle,CodeQuality,

ObservableandRxJSusage,andGameFeatures(includingadvancedfeatures)–

thatareindividuallyweighted.

CodethatdoesnotuseObservablewillnotgetapassinggrade;gamesthatuse

imperative,impure,ormutablecodewillbeheavilypenalised.

Therubricandmarkingguideareprovidedhere.

Report(4marks)

Thereportisintendedtodemonstrateyourtheoreticalunderstandingoffunctional

reactiveprogramming,highlightdesigndecisions,andhelpyourmarkerappreciate

theworkthatyouhaveputintothisassignment.

Importantconsiderationsforthereport:

●Designdecisionsneedtobecorrect

●Needtodisplayunderstandingofcoursematerial

●ReportsmustdemonstrateknowledgeofFRPtoachieveapassingmark

●Markscanbeawardedforstudentsidentifyingissueswiththecodeand

howtheycanbeaddressed

●Avoidfillerinthereport,butincludeenoughinformationtoshowyourmarker

thatyouhaveunderstoodthecoreconcepts

FunctionalProgrammingstyle(8marks)

Thissectionisaboutusingwhatwehavecoveredinlecturesandtutorials.This

involvesconceptslike:

●Small,granularfunctions

●Reusablefunctions,avoidingduplicatecode

●Purity/referentialtransparency

●Fluentinterfacesandfluentcodingstyle

●Manipulationofdifferentcomplextypesandgenerictypes

●HOF,curriedfunctions

●Functioncomposition/chaining

Toachievethemaximumavailablemarks,itisimportanttonotonlyuse

advancedfunctionalprogrammingconcepts,butdosoinausefulway–for

example,improvingthereadabilityofthecodeorfollowingadeclarative

programmingstyle.Forexample,simplycurryingallyourfunctionswillnotreceive

marksunlesstheyarepartiallyappliedsomewhereandusedappropriately

YoumayalsoattempttouseLambdaCalculusconceptsinyourcode;however,be

carefulastheycanoftenjustmakethingshardtounderstand–itwillbeimportantto

explaintheirusageinyourreport,soyourmarkercanbetterappreciateyourwork.

Deductionswillbeappliedforimproperusageoftypes,includingunjustified“any”

types.

CodeQuality(8marks)

Thissectionlooselycoversanythingtodowithhowreadableandunderstandable

yourcodeis.Applyingagoodfunctionalprogrammingstyletendstoincreasethe

readabilityofyourcode.Itisimportantthatyourcodecanbeeasilyunderstood

tohelpyourmarkerappreciateyourwork.

Someexamplesofwhatwelookatare

●Appropriatelinelengths(<80characters)

●Documentationandcommenting(shouldexplainwhythecodeisthewayitis)

●Logicalstructuringoffunctionsandvariables,includingoverallflowof

programlogic

●Appropriatevariablenaming

●Consistentandunderstandableformatting

Usingalinterandformattermayhelpgreatlywiththissection.Seebelowfortipsand

suggestions.

ObservableandRxJSusage(8marks)

ThissectioncoversusageofFRP–didyouuseObservablewell?

Someimportantconsiderations:

●MustmanagegamestateinObservable,andusethescanandmerge

operatorstogetapassingmark(pleaserefertotheAsteroidsexample)

●MusthandlecreationofastreamofnotesusingObservablesandan

appropriatesetofoperations

●UsageofObservableasperdiscussedinthelectures,appliedsessions,

workshop,andintheAsteroidsexample,whilemaintainingpurity,issufficient

forahighmarkinthissectionifimplementedverywellandwithoutissues

●Toachievethemaximummarksavailable,wewanttoseeinterestingand

creativeusesforObservableandRxJSoperators(originalwork)

○ThiscaninvolveimplementingcustomObservablesandresearchinto

theRxJSoperatorsdocumentation

○Refertothemarkingguideforabreakdownofwhatisrequired.

Otherconsiderations:

●Sideeffectsshouldbecontainedasmuchaspossible

●UsingadditionalRxJSoperatorsthatarenotcoveredinclass,orusingthe

onesweintroduceininterestingandnovelways,willbeawardedadditional

marks(giventhattheyareappropriateanduseful)

GameFeatures(2marks)

Thissectionisaboutwhetheryourgamefulfilstherequirements,andtheoverall

complexityofyourgame(andthustheimplementation).

Addingfeaturesshouldnotcomeattheexpenseoftheothercriteria–awell

implementedgamewithfewerfeaturesmayand,oftenwill,achieveahighermark

thanalesswellimplementedgamewithmorefeatures.

Important:Youwillreceivemarksforimplementinggamefeatures,butthismark

willalsocapyourtotalmark.

●Themaximummarkpossibleforimplementingminimumgame

requirementsis70(Distinction)

●Themaximummarkpossibleforimplementingfullgamerequirementsis90

(HD)

●Toachievethemaximumavailablemarks(90+),youmustimplement

advancedrequirements

Somemarkingconsiderations:

●ExtrafeaturesmustfollowFRP

●AdvancedrequirementscanbenotjustgameplaybutextraFRPfeaturestoo

●Tests:forfullmarks,testsneedtobecomprehensiveandnotjust

simple/randomtestcases–theyshouldguidedevelopment

●Bugsandothergameplayrelatedissueswillnotbedeductedfromthis

sectionandbedeductedfromthetotalmark

●Thetotalmarkcapwillbeincreasedwhenimplementingadditionalfeatures.It

ispossibletoachieveanHDbyimplementingtheminimumgame

requirementsandsomefullgamerequirements

Toachievethemaximumavailablemarks,featuresshouldbesignificantand

changehowstateismanagedininterestingways.Discussedfurtherbelow.

Bonusmarksareavailableforparticularlynovel,impressive,oradvancedfeatures.

Notethatmarkscannotexceed100%ofthetotalavailablemarks.

Rubric

TherubricconsistsofMarkingbandsthatrepresentthepossiblegradevaluesfor

implementingrequirements.Thiswillbeacaponyourfinalmark.

TheMarkingguideiswhatTAswillbeusingtomarkyourassignment,andwhatwill

contributetoyourfinalmark/gradeforthisassignment.

Markingbands(summaryofmarkingguide)

Code/ReportqualityImplementation

Minimum

requirements

FullgameFullgame

+extension(s)

Anyofthefollowingarenot

acceptable:Useofimperativecode,

TypeScriptcompileerrors,`any`

types,Notusingrx.js,Nocomments,

Missingorunreadablereport,

Missinginstructionsforhowtoplay

thegame

Notpassing.Notpassing.Notpassing.

Purefunctionalcode(exceptin

`subscribe`handlers),no

compile/runtimeerrors,basic

comments,basicreportcoveringthe

implementedfeatures.Uses

Observableforstatemanagement.

PCC

EffectivelyusesObservableforstate

management,hasgenerictypes,and

sideeffectsareidentified;comments

arebrief,onlydescribingthe

implementation.Thereport

demonstratesbasicunderstandingof

FRPprinciples.Functionsareused

forbroadhighlevelbehaviour.

CDD

Smallpurefunctions,immutabledata

andreusablecodeexploiting

parametricpolymorphism,side

effectsarecontained;complete

commentsexplainingtherationale

andchoicesmadeincode.Advanced

usageofObservable,including

customimplementations.Detailed

reportofimplementedfeaturesthat

demonstratesstrongunderstanding

ofFunctionalProgrammingandFRP.

DHDHD(90+)

Markingguide

FPStyleCodeQualityObservable

0-1markCodeiswritteninan

imperativestyle,use

offor/whileloops

andmutable

variables(let/var).

Modifiesmutable

datastructuresthat

aren’tdeclaredas

readonlytohandle

statemanagement.

NouseofFP

Codeiscompletely

unreadable.

Containsverylarge

codeblockswith

complexnested

logicandlonglines.

Excessiveuseof

singleletterand/or

vaguefunction

names.

Nouseof

observables.Uses

DOMtostorestate

ordoesnotuse

Observabletostore

state.

2marksSomeuseofFPbut

hasnot

demonstratedgood

understanding.

Manyfunctionsare

impureandmodify

state.

Codeisdifficultto

readandrequires

carefulanalysisto

understandintent.

Manypoorchoices

forvariablenames

andmanyexamples

ofcomplexnested

logicwithlackof

documentation.

Someuseof

Observables,but

doesnotutilise

RxJSoperators

suchasscanto

effectivelyhandle

state.Observable

callbackscontain

impurecodeoutside

subscribe.

3marksDemonstratessome

understandingofFP.

Codecontainssome

impurecode.Useof

HOF,butnotutilised

effectively.

Readerisableto

getageneralideaof

code,butisdifficult

toread.Contains

longlinesandlarge

codechunks.Some

attemptatusing

functionsand

splittingupcomplex

logic.

UsesObservables

tohandlestate

managementand

userinteraction.

SomeObservable

methodsarenot

usedeffectivelyor

notasintended,

whichdemonstrates

alackof

understanding.

4marksStyleandstructure

isadaptedfrom

Asteroidsexample,

butisnotadaptedto

fitGuitarHero.Code

isentirelypure.

Abletogetthe

generalideaof

code.Contains

manycomplex

structures,andlarge

chunksofcodethat

requirerefactoring.

Minimal

documentation

Usesobservablesto

handlestate

managementand

userinteraction.

Usessubscribeto

handlestreamlogic;

overuseof

subscribecallback.

5marksSimilarstyletothe

asteroidsexample,

effectivelyadapted

tonewcontext.

Cantellthepurpose

ofeachpieceof

code.Contains

documentation,but

Gooduseofbasic

Observablesfrom

theunit.Some

methodsinthe

Codeisentirelypure

andutilisesthestate

management

systemintroducedin

theAsteroids

example.

somecommentsare

redundant.Some

longlinesandlarge

blocks,butgenerally

minimised.

Observablestream

areoverlycomplex

andcanbebroken

downmore

appropriately.

6marksImprovesthe

Asteroidsexample

considerablyforthe

newgamecontext.

Gooduseofsmall

modularfunctions

andHOF.Shows

greatunderstanding

ofcoursecontent.

Codequalityisof

similarleveltothe

Asteroidsexample

inthenotes.

UtilisesObservable

structurecoveredin

unitcontent

effectively.Good

useofusing

observablesfor

statemanagement.

7-8marksAppliesFPconcepts

inoriginalways

beyondthe

Asteroidsexample.

GreatuseofHOF,

modularfunctions

andacustomtype

system.

Demonstrates

fantastic

understandingof

coursecontentin

noveland

interestingways.

Codeiseasyto

read,intuitiveand

flowswell.Self

documenting

(descriptivevariable

names,easyto

followcodeflow).

Welldocumented

andcommentsare

providedwhen

needed.Nolong

lines,andcodeis

brokenintoreadable

chunks.

Usesinteresting

Observable

methodsnot

coveredincourse

content.Uses

custom

Observables/Subjec

t.

0-0.5marks1mark1.5marks2marks

ReportNotwrittenor

doesnot

correspondto

submission.

Providesa

summaryofthe

code.Contains

somejustification,

butfocusestoo

muchon

summarisingcode.

Containstoomany

screenshotsof

code.

Providesa

summaryofcode

withreferenceto

FRPprinciples

followed.

Demonstrates

some

understandingof

FRPandhowit

wasusedto

managestate.

Somejustification

fordesignchoices

withsomefocus

onwhy.

Clearlywrittenand

concise.Provides

agoodsummary

ofcode.Design

choicesare

justifiedand

considers

tradeoffs.Relates

designchoicesto

FRPandcourse

content.Good

understandingof

FRPandpure

state

management.

Clearlywrittenand

concise.Highlights

onlykeyaspects

ofthecode.

Strong

understandingof

FRPandhowitis

usedtomanage

state.Design

choicesarewell

justified,and

considers

non-trivial

alternativesand

tradeoffs.

FeaturesMarksRunningtotalClassification

Notesarereadfromthe

givenCSVfile0.250.25

Minimum(≤70)

Circlescorrespondingto

eachnotemovedownfrom

thetopcontinuously0.250.5

Notesnotforthecurrent

instrumentareplayedin

thebackground0.250.75

Timingofthenotesaligns

withCSVfile0.251

Score0.251.25

Gameendswhenthesong

ends0.251.5

Notesareplayedwhena

keyispressed(correct

notesifpressedattheright

time,otherwisearandom

note)0.52

Scoremultiplier0.252.25

Full(≤90)

Notetailshavecorrect

lengthcorrespondingto

lengthofnoteifnoteis0.252.5

longerthanonesecond

Notetailsmovedown

alongwiththecircle

continuously0.252.75

Noteswithtailstopplaying

whenkeyisletgo0.253

Noteswithtailsmustbe

heldforcorrectdurationto

beplayedcorrectly0.53.5

Advancedfeature0.54Advanced(90+)

HowtogetanHDorHighHD

ToachieveamarkintheHDrange,youneedtoimplementacompletegamewith

goodstyle.TogetinthehighHDrange,youwillalsoneedtoimplementadvanced

features.

Oneormoreofthefollowing(orsomethingofyourowndevisingwithasimilar

degreeofcomplexity)donewell(ontopofthebasicfunctionalitydescribedabove)

willearnyouahighHD,provideditisimplementedusingthefunctionalprogramming

ideaswehavecoveredinlecturesandclasses:

-Createunittestsandcreateafiletests/main.test.jswhichare

comprehensiveandguidedthedevelopmentoftheprogram

-Abilitytopause/restartagame

-Theabilityforuserstochooseasongforyourgame

-PowerupsorMultipliersforsomenotes,whichgivebonusscorestotheuser.

-Advanced(notrecommendedunlessyoualreadyknowhow):Makea

distributedmultiplayerversion,wrappingthecommsinObservable(you’ll

havetoprovideyourownserverforthis).

Ingeneral,additionalfeaturesforachievingHDandhighHDwillhaveto

non-triviallyimpactyourstatemanagementand/oroverallcomplexityofthe

game.Forexample,apower-upthatchangesthespeedofthenotesdoesnot

requireinterestingusageofstateonitsown,butifpower-upsdecayovertime,then

thatwouldbemoreinterestingandnon-trivial.

Notethataddingfeatureswillgrantyouahighergradeundertheconditionthatit

isdoneinproperFunctionalandFRPstyle.Foranexampleoftheproperstyle,

refertotheexampleAsteroidsGamedescribedintheCourseNotes.

Tipsandsuggestions

Thesearenotpartoftheexplicitrequirements,butarethingswemaylookataspart

ofthemarkingcriteria.Forexample,poorchoicesofvariablenamesmaynothave

anexplicitdeductionbutmayimpactyourcodequalitymarkasitmakesthecode

hardtoread.

Tipsforgettingstarted.

-CompletetheWeek3-5RxJSexercisesandbeginstudyingObservableinthe

coursenotes.

-Onceyouhavecompletedtheabove,workthroughtheexampleAsteroids

GamedescribedintheCourseNotes.Followthesameframeworktobegin

addingfunctionalitytomain.tsasabove.

Moretips.

-FinishalltheJavaScriptandTypeScriptexercisesandthecoursenotesFRP

materialfirst.Theyaredesignedtogiveyoutheskillsyouneedtopreparefor

thisassignment

-Cometotheworkshopsandappliedsessionsforimportanttipsand

assistance

-Attendconsultationsgivenbytheteachingteam.Theyareoftensparseor

emptyaroundthetimeassignmentsarereleased,soitcanbeagreat

opportunitytogetmoredetailedguidanceandfeedback

-AnygeneralquestionsshouldbedirectedtotheEdforumswhenpossible.

However,trytoavoidpostingpotentialsolutions.Ifyoucannotmakethe

consultations,youmaymakeaprivatepostfortheassignmentwithyour

code.

-Yourcodeshouldincludebriefcommentstoexplainlogicanddesignchoices

wherenecessary,ortorefertodetailedexplanationsinyourreport.Please

donotaddcommentsthatareself-evidentfromthecode,e.g.

constx=1;//variablexissetto1.

-Startassoonaspossible.Donotleavetheassignmentuntilit’stoolate.

Recommendedcodingpractices

-Structureyourprograminaconsistentandcoherentmanner(grouprelevant

functions,declarations,andvariablestogether)

-Useblock/sectioncommentstoclearlylayouteachpartofyourcode

-Useniceindentingandformatting

-Bydefault,PrettierisgiventoyouandisintegratedwithVSCode.This

includesformatonsavebydefault.

-FollowtheinstructionsintheREADMEtomanuallyformatyourcode.

-IfyouchoosetouseadifferentIDE,itwillbeleftuptoyoutosetupthe

formattertoyourownsatisfaction.

-UsecamelCasefornames,UpperCamelCasefortypes,andUPPER_CASE

forconstants.

Changelog

●06/08/2024:Updatedasentencefrom:

○Thenotesnotforthecurrentinstrument,willbeplayedwhichcontains

therestofthesong→Thenotesnotforthecurrentinstrument,will

needtobeplayedinthebackground(i.e.,withoutbeingdisplayedon

thegameboard)atthecorrecttime.

●06/08/2024:Updatelatepenaltyfrom10%to5%asperthecurrentMonash

policy

●07/08/2024:Fix

midi_example.ts

instartercodetousethecorrectvelocityas

pertheTone.jslibrary(

midiMaxValue/4

waschangedto

0.25

)

●07/08/2024:Minorimprovementstothestartercode:

○Updatedthe

main

functiontotakeina

samples:{[key:string]:

Tone.Sampler}

parameterandpassthe

samples

objectto

main

○Renamed

start_game

to

startGame

and

csv_contents

to

csvContents

○Overall,thismeansthefollowinglineswerechangedin

src/main.ts

:

■Line108:

exportfunctionmain(csv_contents:string){

to

exportfunctionmain(csvContents:string,samples:{

[key:string]:Tone.Sampler}){

■Line216:

conststart_game=(contents:string)=>{

to

conststartGame=(contents:string)=>{

■Line220:

main(contents);

to

main(contents,samples);

■Line235:

.then((text)=>start_game(text))

to

.then((text)=>startGame(text))

51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: Fudaojun0228