Skip to content

Instantly share code, notes, and snippets.

@alex-hhh
alex-hhh / asteroids.rkt
Created October 22, 2021 23:51
Asteroids game implementation in Racket
#lang racket
;; An Asteroids game in Racket
;; Copyright (c) 2021 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
#lang racket/gui
;; Copyright (c) 2018 Alex Harsanyi
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions:
@alex-hhh
alex-hhh / ishido.rkt
Created July 2, 2020 06:26
Ishido Game Impementation
#lang racket
;; Ishido Game Implementation
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
@alex-hhh
alex-hhh / md-view.rkt
Last active September 14, 2021 13:43
markdown view demo
#lang racket
;; Markdown Viewer
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
@alex-hhh
alex-hhh / tetris-3.rkt
Last active April 3, 2020 15:05
Tetris Game -- Third Version
;; A tetris game -- partial implementation, part 3
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions:
@alex-hhh
alex-hhh / tetris-2.rkt
Last active March 7, 2020 07:39
Tetris Game -- Second Implementation
;; A tetris game -- partial implementation, part 2
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions:
@alex-hhh
alex-hhh / tetris-1.rkt
Created March 7, 2020 01:17
Tetris Game -- First Interactive Application
;; A tetris game -- partial implementation, part 1
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions:
@alex-hhh
alex-hhh / ef-temperature.rkt
Last active February 12, 2020 23:55
efficiency-factor-and-temperature
#lang racket
;; See https://alex-hhh.github.io/2017/12/running-and-outdoor-temperature.html
;; You will need to clone https://github.com/alex-hhh/ActivityLog2 and fix the
;; require below to point to the al-interactive.rkt file. You will also need
;; to update the session ids as they reference activities in my own database.
(require plot)
(require "../../ActivityLog2/etc/al-interactive.rkt")
@alex-hhh
alex-hhh / racket-gui-157-demo.rkt
Created January 22, 2020 23:14
Snip instances with copy - paste functionality -- note that snips are pasted on top of each other, so you need to drag them around with the mouse to see that they were copied
#lang racket/gui
(define chess-piece-snip-class
(make-object
(class snip-class%
(super-new)
(send this set-classname "chess-piece-snip"))))
(send (get-the-snip-class-list) add chess-piece-snip-class)
@alex-hhh
alex-hhh / pwgen-gui.rkt
Created March 27, 2019 03:46
Password Generator Gui
#lang racket/gui
;; Copyright (c) 2019 Alex Harsányi
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions: