| Calculator Project In VBA, make a form, and make a calculator, with a testbox and a series of buttons for addition, subtraction, multiplication, division, and equal. >> View/Complete Assignment: Calculator Project | |
Prolog Homework 3 Trace through the conc procedure, appending a list of four elements to another list of four elements. Write the following prolog procedures, on lists. 1. subst(A,B,C,D) where list D is list C with element A substituted for all occurrences of element B. 2. equal(X,Y) if X and Y are the same set. Also, read thru the following: http://www.ling.helsinki.fi/kit/2004k/ctl272/Bangor/clbook_30.html and do copy and try out the examples. >> View/Complete Assignment: Prolog Homework 3 | | |
Prolog Homework 2
| | |
Prolog Homework 1 Download and install SW-I Prolog. Trace through the sam likes example. Then:
| | |
Homework #11: Dynamic Variables Read this article at Microsoft Research about "Dynamic Variables." Do not read the Appendix to the article just yet, only the main body of the article. Answer the following questions: 1) List two purposes for which they envision using these dynamically scoped variables? 2) Choose one of those two, and motivate it. That is, show what the code would look like when not using dynamic variables, and then what it would look like with dynamic variables. 3) Briefly describe the "simple" and the "novel" implementations. >> View/Complete Assignment: Homework #11: Dynamic Variables | | |
Static Scoping Read this article. Give four reasons why nesting in Ada programs is for the birds. What is the authors' suggestion? Also, read this article about regular expressions in Word, and try the find and replace example in the article. http://office.microsoft.com/en-us/help/HA010873051033.aspx >> View/Complete Assignment: Static Scoping | | |
HW #8 Using VBA for Excel, implement the first FSA from assignment #5. On the spreadsheet, include a formal description of the FSA. This includes the transition function delta. Rather than using Gotos, keep a variable which maintains the present state, and look up the appropriate transition to the next state, based on the present state and the input, from that lookup table on the Excel worksheet. | | |
HW #7 Using VBA for Excel, implement the first FSA from assignment #5. Read the input string from cell B1. Print "accept" or "reject" in C1. Print the sequence of states in cell A4 and down (A5, A6, etc). Use gotos and goto labels to represent the states. Use the MID function to extract letters sequentially from the input string. | | |
Assignment 6: FSAs FSA.doc (38 Kb) Answer the questions in the attached Microsoft Word document about two FSMs. Due Feb 11, 2008 | | |
Assignment 5 Download G95 (sidebar) and install it on your computer. Name the files *.f90 to be able to use FORTRAN 90 syntax. If you name it *.f, you will have annoying restrictions, such as the first 6 characters on a line being reserved. Read through the beginning of the tutorial, here: http://www.cisl.ucar.edu/tcg/consweb/Fortran90/F90Tutorial/tutorial.html Specifically, start with "Exercises and Examples," and do Exercise 2.1 Due Feb 11, 2008 | | |
Assignment #3, 4 #3: Due this Wednesday, Feb 6 In Visual Basic for Applications for Excel, create a macro that puts the numbers 1 through 13 in cells A1 through A13. If possible, do so using the functionality in which you can drag to extend an existing pattern of numbers. Copy the text of the VBA macro which was created, and submit that. #4: Due next Monday, Feb 11 Write two UDFs (User Defined Functions), with meaningful names of your own choosing. The first should take in X and Y and return X times Y. The second should take in X and return X factorial. | | |
Assignment #1, #2 1. Give a short evaluation (a few sentences) of Stroustrup's paper on Generalized Operator Overloading for C++ 2000 in terms of readability and writability. Due approximately Monday, Feb 4. 2. Take some programming language you know and discuss its positive and negative aspects in terms readability, writability, and reliability. (Two or three paragraphs.) Due approximately Monday, Feb 6. |
Thursday, July 03, 2008
Posted by joshwaxman at 11:30 AM 3 comments
Monday, May 26, 2008
subst in Prolog, pt i
The assignment:
"Write subst(A,B,C,D) where list D is list C with element A substituted for all occurrences of element B."
The first case we want to handle is the base case. That is, if we have the empty list, it does not matter what A and B are, because there is nothing to replace. Therefore:
subst(A, B, [ ], [ ]).
Or, because we are using neither A nor B, we can write:
subst(_, _, [ ], [ ]).
The alternative is that we are not dealing with an empty list. In such a situation, we want to define subst recursively, such that we yank out the first element -- the head -- if it is B, and replace it with A. Unless of course the head is not element B, in which case we want to just leave it alone -- that is, put the head back on the list.
The way we pull apart such a list is as [H | T], where H is the head and T is the tail.
More on this later, but hopefully this gets you on the right track. It does not have to work exactly.
Posted by joshwaxman at 2:43 PM 0 comments
Wednesday, May 14, 2008
8, 9, 10, 13, 15, 16
ch 8 -- control structures p 324 and on
if-fi
do
od
ch 9, ch 10: parameter passing
skip 380-387
focus on coroutines, on page 391
in ch 10, statis links, dynamic links
skip ch 11, 12, 14
do chapter 13
Posted by joshwaxman at 2:41 PM 0 comments
Monday, May 12, 2008
Common Lisp Tutorial
http://www.notam02.no/internt/cm-sys/cm-2.2/doc/clt.html
Posted by joshwaxman at 12:55 PM 0 comments
Thursday, May 08, 2008
Not Equal In Prolog
After consulting with this website, actually connected with pop11. :)
The following interaction from SWI-Prolog when consulting j.pl. Use similar code to make sure sally is not her own sibling.
% c:/j.pl compiled 0.00 sec, -292 bytes
11 ?- listing.
myneq(A, B) :-
A\=B.
Yes
12 ?- myneq(a, a).
No
13 ?- myneq(a, b).
Yes
Posted by joshwaxman at 2:24 PM 0 comments
Labels: prolog
Monday, April 28, 2008
Download PopLog, a Free Lisp Interpreter
Here
After installing, modify the shortcut to have a +clisp after the +startup. Try out the examples from the Wikipedia page on Lisp,
http://en.wikipedia.org/wiki/Lisp_%28programming_language%29
aside from any Lisp homework I may assign.
Posted by joshwaxman at 10:18 AM 1 comments