This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this problem we want you to design a function that produces all | |
possible filled boards that are reachable from the current board. | |
In actual tic-tac-toe, O and X alternate playing. For this problem | |
you can disregard that. You can also assume that the players keep | |
placing Xs and Os after someone has won. This means that boards that | |
are completely filled with X, for example, are valid. | |
NOTE: It was said that there would be 512 possible filled in boards | |
following the description above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; #lang htdp/isl | |
(require 2htdp/image) | |
(define-struct dir (name sub-dirs images)) | |
;; Dir is (make-dir String ListOfDir ListOfImage) | |
;; interp. An directory in the organizer, with a name, a list | |
;; of sub-dirs and a list of images. | |
(define I1 (square 10 "solid" "red")) | |
(define I2 (square 12 "solid" "green")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (defsep los) | |
(if (empty? (rest los)) | |
"" | |
", ")) | |
(define (concat los) | |
(cond [(empty? los) ""] | |
[else | |
(string-append (first los) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import Vue from 'vue'; | |
import Component from 'vue-class-component'; | |
@Component({ | |
// Renders just “title: ”... | |
template: '<div>title: {{ theTitle }}</div>' | |
}) | |
export default class App extends Vue { | |
private _title: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DESCRIBE categorias; | |
SELECT CONCAT ( | |
t1.nome | |
, IFNULL (CONCAT (' → ', t2.nome), '') | |
, IFNULL (CONCAT (' → ', t3.nome), '') | |
, IFNULL (CONCAT (' → ', t4.nome), '') | |
) AS fullpath | |
FROM categorias AS t1 | |
LEFT JOIN categorias AS t2 ON t2.parent_id = t1.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang htdp/bsl | |
; | |
; Invariants | |
; ---------- | |
; at each level: | |
; - all accounts in left sub-tree have account number | |
; less than root; | |
; - all accounts in right sub-tree have account number | |
; greater than root; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exercise 1-23. Write a program to remove all comments from a C program. | |
// Don't forget to handle quoted strings and character constants properly. C | |
// comments don't nest. | |
#include <stdio.h> // Includes the standard INPUT/OUTPUT library. | |
#include "lib/helpers.h" /* Includes our own helper functions. */ | |
int main(void) | |
{ | |
printf(/* cmt1 */"%d" /* cmt2 */ "\n", 10); /* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exercise 1-20. Write a program detab that replaces tabs in the input with | |
// the proper number of blanks to space to the next tab stop. Assume a fixed | |
// set of tab stops, say every n columns. Should n be a variable or a symbolic | |
// parameter? | |
// $ gcc -std=c99 -Wall -pedantic -L./lib -o devel devel.c -lmyline | |
// $ LD_LIBRARY_PATH=./lib ./devel <<< $'Li\tnu\tx\t\t!' | |
// len 39, line Li--------nu--------x----------------! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Date | Time Studied | | |
|------------------+--------------| | |
| <2016-11-22 Tue> | 02:30 | | |
| <2016-11-23 Wed> | 01:00 | | |
| <2016-11-25 Fri> | 02:00 | | |
| <2016-11-30 Wed> | 02:00 | | |
| | | | |
| | | | |
| | | | |
| ... | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang htdp/bsl | |
;; #reader(lib "htdp-beginner-reader.ss" "lang")((modname area-tests) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) | |
;; Given length of one side of square, produce the area of the square. | |
(check-expect (area-of-square 3) 3) ;; This test is wrong. | |
(check-expect (area-of-square 3.2) (* 3.2 3.2)) | |
(define (area-of-square side) | |
(* side side)) |