Skip to content

Instantly share code, notes, and snippets.

@cekici
Last active August 5, 2022 12:36
Show Gist options
  • Save cekici/3f9b9d6fa80b1b16221e to your computer and use it in GitHub Desktop.
Save cekici/3f9b9d6fa80b1b16221e to your computer and use it in GitHub Desktop.
Yüksel'in buluşma algoritması
function getYukselsResponse(statics, bulusmaAyarlayan, bulusmaYeri, event, cokIsrar) {
return isBulusmayiAyarlayanYuksel(statics, bulusmayiAyarlayan) ||
isBulusmaYeriYukseleUyuyor(statics, bulusmaYeri) ||
isEventYukseleUyuyor(statics, event) ||
cokIsrar;
}
function isBulusmayiAyarlayanYuksel(statics, bulusmayiAyarlayan) {
return bulusmayiAyarlayan === statics.people.YUKSEL;
}
function isBulusmaYeriYukseleUyuyor(statics, bulusmaYeri) {
return bulusmaYeri === statics.places.HISARUSTU || bulusmaYeri === statics.places.USKUDAR ||
bulusmaYeri === statics.places.MASLAK || bulusmaYeri === statics.places.LEVENT;
}
function isEventYukseleUyuyor(statics, event) {
return event === statics.events.BASKETBOL_MACI || event === statics.events.SAPSAPA_BULUSMA;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment