From 5436fe97bfc05f29add3fba40b9d1b68aa4a9ae8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Mon, 13 Oct 2014 22:57:14 +0200 Subject: [PATCH] . --- fds/fds.xhtml | 84 +++++- xpi/factory_pattern_uml_diagram.jpg | Bin 0 -> 19174 bytes xpi/xpi_06.xhtml | 441 ++++++++++++++++++++++++++++ 3 files changed, 519 insertions(+), 6 deletions(-) create mode 100644 xpi/factory_pattern_uml_diagram.jpg create mode 100644 xpi/xpi_06.xhtml diff --git a/fds/fds.xhtml b/fds/fds.xhtml index d8e5182..66ef77f 100644 --- a/fds/fds.xhtml +++ b/fds/fds.xhtml @@ -31,8 +31,42 @@ //Ensures that we load SWS at the very end, after MathJax has //been initialized + var toggle_circuit = function (id) { + var v = $("#" + id).text(); + var nv = "0"; + if (v == "0") { nv = "1"; }; + $("#" + id).text(nv); + draw_circuit(); + }; + + var draw_circuit = function() { + var i0 = parseInt($("#input0").text()); + var i1 = parseInt($("#input1").text()); + var r = (i0 + i1) % 2; + var c = (Math.floor((i0 + i1) / 2)) %2; + $("#result").text(r) + $("#carry").text(c) + $(".num").each(function (i, e) { + var txt = parseInt($(e).text()); + if (txt == 0) { + $(e).css( 'background', '#aaaaff'); + } else { + $(e).css( 'background', '#aaffaa'); + } + }); + + }; + + + $(window).load(SWS.Presentation.init); + @@ -48,8 +82,7 @@

Comment fonctionne un ordinateur ?

-
@@ -57,7 +90,7 @@

Comment fonctionne un ordinateur ?

@@ -131,13 +164,52 @@ passe (1) ou ne passe pas (0)

-

Compter avec des 0 et des 1 ?

-