ddd58fd534
add platform vector and platform quadtree to game type
Humza Shahid2024-12-17 21:42:06 +00:00
7045b69ce8
eliminate instance of currying/partial application with constant value (a constant mailbox) is shell/shell.sml
Humza Shahid2024-12-17 10:55:58 +00:00
90f8732f06
move msgs into AppType.app_type, and refactor AppUpdate.update function to have type (app_type -> app_type) instead of pervious case which was (app_type -> app_type * MailboxType.t list). Reason: no need to allocate/return tuple when can store messages in type directly; previous msg list will be reset after each app update. All tests after refactor are passing.
Humza Shahid2024-12-17 10:40:06 +00:00
24cdea7da3
pull in new version of railroad library, and make a one-line change to print exclusively tests that have failed (because terminal output is noisy otherwise)
Humza Shahid2024-12-17 09:49:07 +00:00
507c1c331c
scale player.sml in the same way that wall.sml is being scaled, and also: make 'x' and 'y' arguments to Block.lerp Real32.real values rather than int values (with calling code making the necessary changes) as the code was converting between int and real multiple times
Humza Shahid2024-12-17 09:16:22 +00:00
20c4060124
progress in handling variable window width/height (mostly only in imperative shell though)
Humza Shahid2024-12-16 00:58:59 +00:00
cc7f30f718
add GameType.game_type which stores player and wall types, add GameUpdate.update function which takes a game type and returns a new game type, and refactor player/wall files, and gl-draw file, in light of these changes
Humza Shahid2024-12-15 09:10:19 +00:00
1017bf1b7a
cache 'jumpPressed' state inside player type. We use this boolean to check if the player has jumped before. If they have jumped before, then holding the up button does not cause another jump when falling down (unlike before this commit)
Humza Shahid2024-12-14 21:05:51 +00:00
8b8d6f07bc
change floatLimit to 3, which seems to be fine
Humza Shahid2024-12-14 18:11:59 +00:00
df186308bb
reduce floatLimit to 4, which feels better in the game
Humza Shahid2024-12-14 18:07:12 +00:00
62a6a831ed
add FLOATING case to player's y_axis type, so user hovers briefly after jumping, before gravity is applied (this is normal game physics)
Humza Shahid2024-12-14 18:02:57 +00:00
cea269689e
make it so that player will jump shorter distance if they only press up button for short period of time
Humza Shahid2024-12-14 08:18:39 +00:00
34884b1b50
make sure gravity is applied when player walks off platform
Humza Shahid2024-12-14 08:11:23 +00:00
1901043535
add functionality to move player by using arrow keys
Humza Shahid2024-12-14 07:59:43 +00:00
57f012d655
reimplement vi0 and helper functions so that they are likely faster (vi0 bring cursor to start of current line; before, this was done by checking each character in the string backwards, but now it is done by looking at the line metadata, which is faster for us by some constant factor)
Humza Shahid2024-11-26 21:57:02 +00:00
c28dc429b7
address todo in text-builder.sml by adding prerequisite: always call SearchList.goToNum before calling TextBuilder.build
Humza Shahid2024-11-25 04:37:47 +00:00
d399016c1a
add 'SearchList.exists' function to fcore/search-list.sml function, and make sure we check if mmatchedIdx exists before inserting or appending (so we maintain set-like semantics where each number exists only once)
Humza Shahid2024-11-24 21:38:58 +00:00
c6343cac40
in fcore/search-list.sml, only call 'insMiddle' function if new value is not in middle
Humza Shahid2024-11-24 20:42:17 +00:00
eb3eb6c41f
fix bug in '^' motion: only move cursor if (chr = /home/humza/Downloads/sml/shf/fcore/cursor.sml' '), not if Char.isSpace (which also returns true if chr is newline or tab) is true
Humza Shahid2024-11-24 20:32:47 +00:00
7d73146cf4
remove line breaks between tests in test/test.sml, because more code fits on screen that way, and the differing intentation is enough of a visual sign to mark when new test begins (aside from the 'test' keyword itself)
Humza Shahid2024-11-24 19:43:06 +00:00
04d4e013e2
ensure that searchList is deleted from when calling delete functions other than 'helpRemoveChr'
Humza Shahid2024-11-23 06:10:40 +00:00
0bfe549e04
add just one more 'word' test, extract steps to delete from search list into a reusable function (don't need to memorise the steps), and fix bug in cursor.sml where we were looking at tl without calculating correct strIdx
Humza Shahid2024-11-23 05:16:37 +00:00
c48eeb07b3
finish testing motions for 'k', meaning tests for hjkl motions are complete (can test other motions like 'w', '0', 'e', etc. next, and then test delete motions after that)
Humza Shahid2024-11-19 13:02:13 +00:00
26850da6d3
done testing 'j' motion; next is to test 'k' motion
Humza Shahid2024-11-19 06:43:00 +00:00
f6d4b10d44
break test suite in test.sml into more managable chunks (one test per motion)
Humza Shahid2024-11-19 06:35:47 +00:00
96080d0964
a bit of repository management (add Makefile to make it less verbose to run tests, and add .gitignore to avoid committing built binaries)
Humza Shahid2024-11-19 04:32:37 +00:00
afcd3ee70b
add additional tests for vi's 'h' and 'l' motions
Humza Shahid2024-11-19 04:21:54 +00:00
ef395feea8
add similar fix described in previous commit to 'moveLeftAndDelete' function
Humza Shahid2024-11-18 11:42:23 +00:00
25046dcb88
bug fix to search-list.sml's 'moveRightAndDelete' function by possibly deleting if start > finish, rather than terminating
Humza Shahid2024-11-18 11:29:54 +00:00
e90df37b43
in search-list.sml: fix 'delRightFromHere' and 'delLeftFromHere' functions which joined newHd with left/right, rather than the tl, and therefore added new numbers to the list, which is incorrect behaviour. Fixed this by using joining with 'tl' rather than left/right. In build-search-list.sml: make fromRange function return tuple instead of an instance of app. Finally, in app-update.sml: progress towards refactoring 'helpRemoveChr' function to map and delete from searchList as desired.
Humza Shahid2024-11-17 09:25:01 +00:00
f7cc2d4740
change 'targetLength' of SearchList.t from 1024 to 32
Humza Shahid2024-11-16 19:59:46 +00:00
5e9f118b15
fixed two issues related to insertion in search-list.sml. First issue: in top level 'insert' function, we called 'insLeft' if new value is greater than first value on right, and we called 'insRight' in the opposite case; this is backwards. Second issue: in base cases of 'insLeft' and 'insRight', when we have reached the end of one side of the list, we used to return the same list we got back instead of adding the new value to this end of the list; this is now fixed.
Humza Shahid2024-11-16 19:51:29 +00:00
09d9945201
add function to build search list from specific range
Humza Shahid2024-11-16 12:27:14 +00:00
f2b4f256ec
bugfix: in search-list.sml's 'delRightFromHere' function, make sure we preserve the last part of the vector when finish < last
Humza Shahid2024-11-16 09:05:47 +00:00
436b3e0d92
simplify and rewrite function 'del' in search-list.sml
Humza Shahid2024-11-16 08:33:26 +00:00
0ba56bf6d3
amend lambdas in search-list.sml's 'moveRightAndMap' function, where wrong variable was used in lambda, and rename 'num' variable in that function to 'from' to make purpose and intent clearer
Humza Shahid2024-11-16 04:55:02 +00:00
d6c59e140e
replace text-builder.sml's 'buildCursor' function with a new 'Rect.lerp' function (which is in fcore/rect.sml)
Humza Shahid2024-11-15 21:14:43 +00:00
2a2f64f00c
add bgVertexBuffer and bgProgram to imperative shell, so we can draw bg and cursor without overlap, and without z-index
Humza Shahid2024-11-15 10:26:22 +00:00
d5eb19f8d9
progress drawing spaces within search string, and drawing behind background of search string
Humza Shahid2024-11-15 09:50:35 +00:00
025f9d2bf4
fix exception in bin-search.sml, by making sure that forwardLinearSearch always starts at 0 or more
Humza Shahid2024-11-15 09:24:48 +00:00
c0c1a7c885
refactor app-update.sml to pass additional parameters to TextBuilder.build
Humza Shahid2024-11-15 08:24:48 +00:00
35de4582e9
refactor TextBuilder and inner functions to handle highlighting searched characters
Humza Shahid2024-11-15 08:13:32 +00:00
91688441cf
refactor fcore/text-builder.sml to take non-changing parameters as records, for brevity
Humza Shahid2024-11-15 06:43:14 +00:00
df9c0e3b51
break out of infinite loop in build-search-list.sml's 'helpBuild' function, by passing 'matchedIdx + 1' to tail call, and return correct matchedIdx value from 'helpNextMatch' function by adding 1 rather than subtracting
Humza Shahid2024-11-15 06:04:11 +00:00
13d6d51fe9
when buildinng search list, also save searchString into app
Humza Shahid2024-11-15 05:40:57 +00:00
cac0d02fab
initial implementation of building search list
Humza Shahid2024-11-15 05:37:53 +00:00
f279dc0937
make 'de', 'dE', 'dj' and 'dk' commands work similarly to vi (details are in comments)
Humza Shahid2024-11-14 08:57:31 +00:00
11df1a6bcd
done implementing delete function in SearchList
Humza Shahid2024-11-13 03:49:12 +00:00
fb236aa7a1
add another helper function for deleting in SearchList. (Only one more helper function to go now.)
Humza Shahid2024-11-13 03:15:20 +00:00
204d171893
implement a couple of more helper functions for deletion
Humza Shahid2024-11-12 20:46:07 +00:00
b24dbd0ede
implement a helper function for delete
Humza Shahid2024-11-12 13:07:28 +00:00
9b45f43948
start implementing delete in search-list.sml (with top-down programming, calling functions that do not yet exist)
Humza Shahid2024-11-12 09:14:39 +00:00
3b81d087f0
implement function to go specific number in search-list.sml
Humza Shahid2024-11-12 07:57:36 +00:00
ae68627a8f
pull minor line_gap.sml update (not user facing or significant)
Humza Shahid2024-11-10 22:03:12 +00:00
50a7935612
minor change the nullSubstring function (use string literal for endWith parameter; no need to convert char to string)
Humza Shahid2024-11-10 22:02:22 +00:00
681905ff15
receive new version of line_gap.sml which has new function to build a null-terminated substring for C FFI
Humza Shahid2024-11-10 21:58:42 +00:00
6eb74c4332
add a substring function to line_gap.sml which is null terminated, which may be required for C FFI
Humza Shahid2024-11-10 21:57:04 +00:00
79a4935dec
receive updated version of line_gap.sml, which gives us ability to use substring
Humza Shahid2024-11-10 11:15:56 +00:00
c2e74d89fd
fully implement substring for line_gap.sml
Humza Shahid2024-11-10 11:13:12 +00:00
2cd6605ee4
progress adding substring to line_gap.sml
Humza Shahid2024-11-10 10:41:41 +00:00
5294da6780
use 'Cursor.clipIdx' in app-update.sml's 'helpDelete' and 'helpDeleteLine' functions, to ensure we never delete last line (unix text files always end with \n)
Humza Shahid2024-11-10 07:57:49 +00:00
6e4f6b58b9
done with 'parseDelete' functionality in app-update.sml': have all the delete commands I would like
Humza Shahid2024-11-10 07:51:12 +00:00
58a9c2ec69
add functionality for commands: 'dgg' (delete from cursor to start of buffer), 'dge' (delete from cursor to the end of the previous word) and 'dgE' (delete from cursor to the end of the previous WORD)
Humza Shahid2024-11-10 07:34:30 +00:00
bc27925e75
similar loop optimisations described in previous commit to app-update.sml's 'helpDeleteToChr' function
Humza Shahid2024-11-09 10:49:54 +00:00
fed827a6c9
same loop optimisation mentioned in previous commit to app-update.sml's 'helpDelete' function
Humza Shahid2024-11-09 10:41:37 +00:00
dece4d4d83
break out of loop early in 'helpMove' and 'helpMoveToChr' functions, in case where calling 'fMove' returned the same value as before
Humza Shahid2024-11-09 10:11:51 +00:00