Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Post Your First Piece Of Work! (For Laughs)


TheDeadlyHaze
 Share

Recommended Posts

Pretty much what the title says, post your first piece of work you thought you could use without any errors and we will all laugh at it! GO!

 

function KillCounter( victim, killer, weapon )  --Sets up a new function called KillCounter
    if killer:GetNWInt("killcounter") == 10 then
	    PrintMessage(HUD_PRINTTALK, "Player" .. killer:GetName() .. "May be rdming")  --When the killcounter equals 10 it will
	    PrintMessage(HUD_PRINTTALK, "Player" .. Killer:GetName() .. "Has killed" .. victim:GetName()) -- Shows who the killer killed			  
    end
end

Link to comment
Share on other sites

  • 2 weeks later...
function Warp( ply )
   if ply:IsAdmin() or ply:IsSuperAdmin() or ply:GetUserGroup("owner") or ply:GetUserGroup("mod") then
    ply:SetPos( Vector(0,0,0) )
    ply:ChatPrint("Warped to the secret admin room!")
   else
    ply:ChatPrint("Ay mate , you're not an admin!")
   end
end
concommand.Add( "adminroom", Warp )

  • Like 1
Link to comment
Share on other sites

I didn't have any errors though lol

 

 

import java.util.Scanner;
public class TempConverter {
public static void main(String[] args) {

/**
* Author: Troy Wingert
* Version: 1.0 Aug. 17, 2010
* Converts degrees Celsius to degrees Fahrenheit
*/
double celcius = 0;
double fahrenheit = 0;

System.out.println("Temperature Converter");
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter a number representing degrees Celsius: ");
celcius = keyboard.nextDouble();

fahrenheit = (9/5) * celcius + 32.0;
System.out.println(celcius + " in degrees celcius is " + fahrenheit + " in degrees fahrenheit.");
}
}

Edited by captaincracker
  • Like 1
Link to comment
Share on other sites

From the time when I used to do warcraft/wcs mod coding for a css clan..

This was one of my first..

 

[something different]
#Requirement section
required = 0
maximum = 0

#Restrict section
restrictmap = ""
restrictteam = 0
restrictitem = ""

#Other info
author = "Toast++"
desc = "OP race"
spawncmd = ""
deathcmd = ""
roundstartcmd = ""
roundendcmd = ""
preloadcmd = ""
allowonly = "STEAM_0:1:36899494"
onchange = ""

#Skill information
numberofskills = 5
numberoflevels = 4
skillnames = "God gives HP back|Speedhack|Flamethrower|Bulletproof|Iceage"
skilldescr = "Regenerate HP|Speed|Burn|Evade|Freeze"
skillcfg = "player_spawn|player_spawn|player_attacker|player_victim|player_attacker"
skillneeded = "0|0|0|0|0"

#Skill specific information
[[skill1]]
setting = "es_xset wcs_hp 7;es_xset wcs_time 15;es_xset wcs_waves 10;es_xset wcs_radius 150|es_xset wcs_hp 9;es_xset wcs_time 15;es_xset wcs_waves 12;es_xset wcs_radius 180|es_xset wcs_hp 11;es_xset wcs_time 15;es_xset wcs_waves 14;es_xset wcs_radius 200|es_xset wcs_hp 13;es_xset wcs_time 15;es_xset wcs_waves 12;es_xset wcs_radius 220"
cmd = "es wcsgroup set regeneration event_var(userid) 1;es wcsgroup set regen_round event_var(userid) server_var(wcs_roundcounter);es_xrand wcs_rand 3 15;es_delayed server_var(wcs_rand) wcs_regeneration event_var(userid) server_var(wcs_hp) server_var(wcs_time) 150 -1 server_var(wcs_radius)"
sfx = ""

[[skill2]]
setting = "es_xset wcs_speed 1.5|es_xset wcs_speed 2.0|es_xset wcs_speed 2.5|es_xset wcs_speed 3.0"
cmd = "es wcs_setfx speed event_var(userid) = server_var(wcs_speed) 0;es_tell event_var(userid) #multi #green[#lightgreenSpeed#green] #lightgreenis activated."
sfx = ""

[[skill3]]
setting = "es_xset wcs_chance 10;es_xset wcs_time 1|es_xset wcs_chance 20;es_xset wcs_time 2|es_xset wcs_chance 30;es_xset wcs_time 3|es_xset wcs_chance 30;es_xset wcs_time 4"
racealias_bm4 = "es wcs_setfx burn event_var(userid) = 1 server_var(wcs_time);es wcs damage event_var(userid) event_var(attacker) server_var(wcs_damage);es wcs_xtell event_var(userid) r_flame attacker event_var(es_attackername) victim event_var(es_username);es wcs_xtell event_var(attacker) r_flame attacker event_var(es_attackername) victim event_var(es_username)"
cmd = "if (server_var(wcs_dice) <= server_var(wcs_chance)) then wcs_xalias racealias_bm4"
sfx = ""

[[skill4]]
setting = "es_xset wcs_chance 20|es_xset wcs_chance 30|es_xset wcs_chance 40|es_xset wcs_chance 50"
cmd = "es wcx_evade event_var(userid) server_var(wcs_chance)"
sfx = ""

[[skill5]]
setting = "es_xsetinfo wcs_chance 4|es_xsetinfo wcs_chance 7|es_xsetinfo wcs_chance 16|es_xsetinfo wcs_chance 28"
racealias_nevstm = "es est_Freeze event_var(userid) 1;es es_xdelayed 3 wcs_removefx freeze event_var(userid);wcs_getlanguage wcs_lng wcs_lng_r_gotfrozenby;es es_xformat wcs_lng server_var(wcs_lng) event_var(es_attackername);esnq est_csay event_var(userid) server_var(wcs_lng);wcs_getlanguage wcs_lng wcs_lng_r_froze;es es_xformat wcs_lng server_var(wcs_lng) event_var(es_username);esnq est_csay event_var(attacker) server_var(wcs_lng);racealias_nevstv"
racealias_nevstv = "es_xgetplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid);es est_effect 10 #a 0 sprites/lgtning.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 50 150 3 150 50 0 55 55 15 255 10;es_toptext event_var(attacker) 1 #pink Effects by HOLLIDAY;es est_effect 10 #a 0 sprites/lgtning.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 72 157 3 175 75 0 75 0 255 255 50"
cmd = "es es_xif (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_nevstm"
sfx = ""

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

The language is Kiss-C and it was for robotics. It was to make a robot "ping pong" between two walls every time it hit a wall.

 

int i=0;
int m=100;
int sensor=255;
int sensor2=255;
int main()
{
while(i < 6)
{
 if (analog(0)!=sensor)
 {
 move();
 printf("Moving backwards\n");
 }

 if (analog(1)!=sensor2)
 {
 move();
 printf("Moving forwards\n");
 }
}
}
void move()
{
motor(0, m);
motor(3, m);
sleep(1);
i++;

Edited by BlackEyes
  • Like 1
Link to comment
Share on other sites

  • 10 months later...
  • 3 weeks later...

Worst Calculator ever

import javax.swing.JOptionPane;
public class varibles2 {
public static void main (String args[])
{
double base = 2.1;
double height = 3.141592654;
double area = (base * height) /2;
JOptionPane myIO = new JOptionPane();
myIO.showMessageDialog(null, area);
}
}

Edited by 7Z.
Link to comment
Share on other sites

When i was taking programming in highschool. Some VB code. I hated that class though i still have all the files i made, but can't open any.

Private Sub txtPrice_AfterUpdate()

txtTax = txtPrice * 0.06
txtTotal = txtTax + txtPrice

End Sub

Link to comment
Share on other sites

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FirstSteps
{
public partial class Form1 : Form
{
 //Globale variabelen
 double invoer1Azog1;
 double invoer2Azog2;
 double resultAzog;
 public Form1()
 {
	 InitializeComponent();
 }
 private void textBox3_TextChanged(object sender, EventArgs e)
 {
 }
 private void button1_Click(object sender, EventArgs e)
 {
	 try
	 {
		 invoer1Azog1 = Convert.ToDouble(tbinvoer1Azog.Text);
		 invoer2Azog2 = Convert.ToDouble(tbinvoer2Azog.Text);
		 resultAzog = invoer1Azog1 + invoer2Azog2;
		 tbResultAzog.Text = Convert.ToString(resultAzog);
	 }
	 catch
	 {
		 MessageBox.Show("Niets ingevult");
	 }
 }
 private void button2_MouseMove(object sender, MouseEventArgs e)
 {
	 tbMoveAzog.Text = "Move";
 }
 private void button2_MouseLeave(object sender, MouseEventArgs e)
 {
	 tbMoveAzog.Text = " ";
 }
 private void textBox1_TextChanged(object sender, EventArgs e)
 {
 }
 private void textBox2_TextChanged(object sender, EventArgs e)
 {
 }
 private void Form1_Load(object sender, EventArgs e)
 {
	 this.BackColor = Color.Aqua;
 }
 private void btnPowerAzog_Click(object sender, EventArgs e)
 {
	 PlusTestAzog();
 }
 private void PlusTestAzog()
 {
	 PowerAzog();
 }
 private void PowerAzog()
 {
	 try
	 {
		 invoer1Azog1 = Convert.ToDouble(tbinvoer1Azog.Text);
		 invoer2Azog2 = Convert.ToDouble(tbinvoer2Azog.Text);
		 //resultAzog = invoer1Azog1 + invoer2Azog2;
		 resultAzog = Math.Pow(invoer1Azog1, invoer2Azog2);
		 tbResultAzog.Text = Convert.ToString(resultAzog);
	 }
	 catch
	 {
		 MessageBox.Show("Niets ingevult");
	 }
 }
 private void btnRedAzog_Click(object sender, EventArgs e)
 {
	 this.BackColor = Color.Red;
	 PowerAzog();
 }
 private void btnGreenAzog_Click(object sender, EventArgs e)
 {
	 this.BackColor = Color.Green;
	 PlusTestAzog();
 }
 private void btnTextAzog_Click(object sender, EventArgs e)
 {
	 MessageBox.Show("Gemaakt door :\tAltin Zogaj \n" + " Datum: :\t29-08-2013");
 }

}
}

I used to write in Dutch later on I got better in english :)

This were my first steps building a calculator in Visual studia written in C#

Edited by UnPrePared_
Link to comment
Share on other sites

  • 1 month later...

Public class Addthatshit{
public static void main (String [] args)
scanner addition  = new scanner
System.out.println("type a number bitch");
int a  = addition.nextInt()
System.out.println("type another number bitch");
int b = addition.nextInt()
int c  = a+b;
System.out.println("Those numbers equal " + c);

I wasn't awful at coding when I first started.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share