arcticmouse's public fiddles
-
Write a function charFreq() that takes a string and builds a frequency listing of the characters contained in it. Represent the frequency listing as a Javascript object. Try it with something like charFreq("abbabcbdbabdbdbabababcbcbab").
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Write a function filterLongWords() that takes an array of words and an integer i and returns the array of words that are longer than i.
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Write a function findLongestWord() that takes an array of words and returns the length of the longest one.
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Represent a small bilingual lexicon as a Javascript object in the following fashion {"merry":"god", "christmas":"jul", "and":"och", "happy":gott", "new":"nytt", "year":"år"} and use it to translate your Christmas cards from English into Swedish.
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Define a function reverse() that computes the reversal of a string. For example, reverse("jag testar") should return the string "ratset gaj".
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Define a function sum() and a function multiply() that sums and multiplies (respectively) all the numbers in an array of numbers. For example, sum([1,2,3,4]) should return 10, and multiply([1,2,3,4]) should return 24.
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Write a function translate() that will translate a text into "rövarspråket". That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothohisos isos fofunon".
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Write a function that takes a character (i.e. a string of length 1) and returns true if it is a vowel, false otherwise.
http://www.ling.gu.se/~lager/teaching/dialogue_systems%20II/labs/javascript.html
-
Sum Method
No-Library (pure JS), HTML, CSS, JavaScript
-
Reverse a string
No-Library (pure JS), HTML, CSS, JavaScript
-
Slideshow
jQuery 1.6.4, HTML, CSS, JavaScript