Jump to content

Don't Click This


NASI Director

Recommended Posts

I present to you my second clickreation. Pleasure clicking with you all. Clickclickclick
I actually completed this yesterday, decided to post it today (it was almost 12AM when I finished it) but found out in the morning it was locked. Now I can click again... not sure what to come up with next time.

/* Click!! 2023-02-04. -click2
 * The only dependency is libcaca.
 * Compile it: gcc click2.c -o click2 -lcaca
 * 
 * UNLICENSE:
 * This is free and unencumbered software released into the public domain.
 * Anyone is free to copy, modify, publish, use, compile, sell, or
 * distribute this software, either in source code form or as a compiled
 * binary, for any purpose, commercial or non-commercial, and by any
 * means. Read the full text: https://unlicense.org/#the-unlicense */

#include <caca.h>
#include <stdlib.h>
#include <stdio.h>

caca_canvas_t *cv;
caca_display_t *dp;
caca_event_t m_event;
caca_event_t k_event;

void main(void)
{
	dp = caca_create_display(NULL);
	if (!dp) {
		printf("failed to initialize. no clicks for you today\n");
		exit(1);
	};

	caca_set_display_time(dp, 1000);
	cv = caca_get_canvas(dp);
	caca_set_display_title(dp, "Click!!");
	caca_set_color_ansi(cv, CACA_BLACK, CACA_WHITE);
	caca_refresh_display(dp);

	while (1) {
		caca_get_event(dp, CACA_EVENT_MOUSE_RELEASE, &m_event, 20);
		caca_get_event(dp, CACA_EVENT_KEY_PRESS, &k_event, 20);
		if (caca_get_event_key_ch(&k_event) == CACA_KEY_CTRL_C) {
			caca_free_display(dp);
			exit(0);
		}
			
		caca_gotoxy(cv, caca_get_mouse_x(dp)-3,
				caca_get_mouse_y(dp));
		caca_put_str(cv,caca_get_mouse_x(dp)-3,
				caca_get_mouse_y(dp),"Click!");
		caca_refresh_display(dp);
	}
}

 

Edited by tajwo
public domain
Link to comment
Share on other sites

I hereby add a click that clicked the clickiest click that clicked a click that clicked the click that was the clickiest click that ever clicked a click that clicked a click that could click this 

calvin-and-hobbes-click.gif

that broke Calvin so bad he became a negative click that unclicked a click that did click! Thusly a new click is added to the clicks that dare not click yet dare to click clicks that CLICK!

am i ok? I dont know. So CLICK!

073302052023

 

Edited by AlamoVampire
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...